mysql> create table t (sizes set('Extra-small','Small','Medium','Large','XLarge','XXLarge','XXXLarge'), colorsShadesNumbersShort set('blue:333399','gray:465945','purple:50404D','navy-blue:CC7722','fuchsia:FF77FF','aqua:7FFFD4','maroon:B03060','black:0000FF','yellow:9ACD32')); Query OK, 0 rows affected (0.00 sec)

mysql> insert into t values ('Large,Small', 'aqua:7FFFD4,fuchsia:FF77FF');
Query OK, 1 row affected (0.00 sec)

mysql> select * from t;
+-------------+----------------------------+
| sizes       | colorsShadesNumbersShort   |
+-------------+----------------------------+
| Small,Large | fuchsia:FF77FF,aqua:7FFFD4 |
+-------------+----------------------------+
1 row in set (0.01 sec)

mysql> update t set sizes= 'Extra-small,Large,Small,Medium,XLarge,XXLarge,XXXLarge', colorsShadesNumbersShort= 'aqua:7FFFD4,blue:333399,gray:465945,navy-blue:CC7722,black:0000FF,maroon:B03060,purple:50404D,yellow:9ACD32,fuchsia:FF77FF';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0


mysql> select * from t\G
*************************** 1. row ***************************
sizes: Extra-small,Small,Medium,Large,XLarge,XXLarge,XXXLarge colorsShadesNumbersShort: blue:333399,gray:465945,purple:50404D,navy-blue:CC7722,fuchsia:FF77FF,aqua:7FFFD4,maroon:B03060,black:0000FF,yellow:9ACD32
1 row in set (0.00 sec)

/ Carsten

Victor Subervi skrev:
On Wed, Jan 6, 2010 at 2:40 PM, Michael Dykman <mdyk...@gmail.com> wrote:

How about you show us the schema for the table so we know what is
defined as what?


Done in last email.

Also, as the update does succeed, it would be interesting to see what
value actually got stored.  After you have accounted for each bit in
the stored value, we might have a clue about what is being truncated.


mysql> select sizes, colorsShadesNumbersShort from products;
+-------------+--------------------------+
| sizes       | colorsShadesNumbersShort |
+-------------+--------------------------+
| Extra-small | blue:333399              |
| Extra-small | aqua:7FFFD4              |
| Extra-small | blue:333399              |
|             |                          |
+-------------+--------------------------+
4 rows in set (0.00 sec)

Ain't nothin' getting stored.

One thing I did just note: the hyphen in 'Extra-Small'.  Set
identifiers need to be valid mysql identifiers and the hyphen '-' is
not a valid identifier character (as it is an arithmatic operator).  I
can't imagine that those colons in the colour list are healthy either.


They all work except in a certain case where I had to pull the hyphen out. I
can enter all of these products individually.

The point of a set identifier to be an easy mnemonic for a particular
bit value.  Nothing is gained by trying to represent data with the
identifier itself.


Huh? Please explain.
V


!DSPAM:451,4b44da73427881287616796!


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to