Hi Karsten,

I'm quite sure you have special characters in the end of the field
T_Instance for T_Instance like "VA_SD_STOPFENFUEHRUNG".
Can you display the contents of this field in hex format?

Regards,

Laercio.

-----Original Message-----
From: Karsten Backhaus
[mailto:[EMAIL PROTECTED] 
Sent: quinta-feira, 1 de julho de 2004 06:24
To: [EMAIL PROTECTED]
Subject: select, = and like

Hi,

im running mysql-4.0.18-2, all tables are innodb tables. I found the
following which i dont understand:

one of my tables is named 'PARAMSET_EXT':
mysql> explain PARAMSET_EXT;
+------------+-------------+------+-----+---------+-------+
| Field      | Type        | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| PS_Name    | varchar(64) |      | PRI |         |       |
| T_Instance | varchar(64) |      | PRI |         |       |
| User       | varchar(64) | YES  |     | NULL    |       |
| Modified   | bigint(80)  |      |     | 0       |       |
| D_ID       | int(11)     | YES  | MUL | NULL    |       |
| Confirmed  | tinyint(1)  |      |     | 0       |       |
+------------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)
mysql>


now i send the following select statement and get the following results:
mysql> select PS_Name, T_Instance, User from PARAMSET_EXT where PS_Name 
mysql> = "1";
+---------+--------------------------+--------+
| PS_Name | T_Instance               | User   |
+---------+--------------------------+--------+
| 1       | L2_SD_LOOP_DATA1         | vai_l2 |
| 1       | VA_SD_FUCHSPLATTE        | vai_l2 |
| 1       | VA_SD_GIESSPULVER        | vai_l2 |
| 1       | VA_SD_GIESSROHRWECHSEL   | vai_l2 |
| 1       | VA_SD_STOPFENFUEHRUNG    | vai_l2 |
| 1       | VA_SD_VERTEILEREINBAUTEN | vai_l2 |
+---------+--------------------------+--------+
6 rows in set (0.00 sec)
mysql>


now i send the following select statement and get the following result:
mysql> select PS_Name, T_Instance, User from PARAMSET_EXT where 
mysql> T_Instance = "VA_SD_STOPFENFUEHRUNG";
Empty set (0.01 sec)
mysql>

ok, i expected to get the entry
| 1       | VA_SD_STOPFENFUEHRUNG    | vai_l2 |
but, i got an "empty set".

(note, that selecting for "T_Instance"s other than "VA_SD_STOPFENFUEHRUNG"
works!)

however, the following statement works fine:
mysql> select PS_Name, T_Instance, User from PARAMSET_EXT where 
mysql> T_Instance like "VA_SD_STOPFENFUEHRUNG";
+---------+-----------------------+--------+
| PS_Name | T_Instance            | User   |
+---------+-----------------------+--------+
| 1       | VA_SD_STOPFENFUEHRUNG | vai_l2 |
--------------------------------------------

and now, since the "_" character is a wildcard in the "like" context, i
tried:
mysql> select PS_Name, T_Instance, User from PARAMSET_EXT where 
mysql> T_Instance like "VA\_SD\_STOPFENFUEHRUNG";
Empty set (0.00 sec)
mysql>

which results in an empty set.

why does selecting for "VA_SD_STOPFENFUEHRUNG" not work?
Is this some kind of bug or is there anything iam doing wrong?
note, that there are NO special characters in "VA_SD_STOPFENFUEHRUNG",
except of the "_" which is allowed in this context, isnt it?

regards
Karsten
--
perl -MLWP::Simple -e '$u="http://www.dilbert.com";foreach(split/>/,
   LWP::Simple::get($u)){LWP::Simple::getstore("$u$1","dilbert.gif")
   if(m#<IMG SRC="(/comics/dilbert/archive/images/[^"]*)"#)}'

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to