Hi!

First of all, MEDIUMBLOB type is case-sensitive.
I checked this sequence and everything worked  as
expected. I think you have a mistake in your table.
What does "SHOW CREATE TABLE table" give?

Second, there is no needs to check that the value is already
presents using "SELECT" just to avoid an attempt of double
key value inserting. It is safe to insert without selecting.
After inserting you have just to check that really happened,
either record was inserted or error happened.


Why do you want to do iy
Stefan Kuhn wrote:
> Hi everybody,
> I've got a MEDIUMBLOB column in a table, where I want values to be unique. So 
> I made it UNIQUE.
> When my program wants to enter a value, it first does a select * from table 
> where column =x in order to see if x already exists, if not, it does an 
> insert. Now the interesting point:
> If there is c1ccccc1 in the column and I want to insert C1CCCCC1, the select 
> says, that this is not existing, so the insert is done. Then mySQL complains 
> about double keys. It seems that the UNIQUE comparision is not done 
> case-sensitive in BLOB-columns, which is bad.
> Does anybody have an idea about how to solve this (I need the column to be 
> case-sensitive).
> Many thanks
> Stefan
> 



-- 
For technical support contracts, visit https://order.mysql.com/
    __  ___     ___ ____  __
   /  |/  /_ __/ __/ __ \/ /    Mr. Alexander Barkov <[EMAIL PROTECTED]>
  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
/_/  /_/\_, /___/\___\_\___/   Izhevsk, Russia
        <___/   www.mysql.com   +7-902-856-80-21


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to