List:General Discussion« Previous MessageNext Message »
From:Jake Peavy Date:June 1 2006 5:35pm
Subject:Re: name 'Szczech' returns more rows then 'Szczec%'
View as plain text  
On 6/1/06, Lukasz Budnik <lukasz.budnik@stripped> wrote:

> name column is:
>
>   `name` varchar(50) NOT NULL default 'NN'
>
> and table is DEFAULT CHARSET='latin2' but as I wrote before
> all those names have only latin1 characters
>

I am not able to reproduce it on 5.0.16 on WinXP.

mysql> DROP TABLE IF EXISTS `lbudnik-test`;
Query OK, 0 rows affected (0.02 sec)

mysql> CREATE TABLE `lbudnik-test` (
    ->  `id` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
    ->  `name` VARCHAR(50) NOT NULL default 'NN',
    ->  PRIMARY KEY (id)
    -> ) ENGINE=MyISAM DEFAULT CHARSET=latin2;
Query OK, 0 rows affected (0.10 sec)

mysql> INSERT INTO
    ->  `lbudnik-test`
    -> VALUES
    ->  (NULL,'Szczechura'),
    ->  (NULL,'Szczechowiak'),
    ->  (NULL,'Szczechowski'),
    ->  (NULL,'Szczech'),
    ->  (NULL,'Szczech'),
    ->  (NULL,'Szczeb'),
    ->  (NULL,'Szczec');
Query OK, 7 rows affected (0.00 sec)
Records: 7  Duplicates: 0  Warnings: 0

mysql> SELECT id, name FROM `lbudnik-test` WHERE name LIKE 'Szczec%';
+----+--------------+
| id | name         |
+----+--------------+
|  1 | Szczechura   |
|  2 | Szczechowiak |
|  3 | Szczechowski |
|  4 | Szczech      |
|  5 | Szczech      |
|  7 | Szczec       |
+----+--------------+
6 rows in set (0.00 sec)

mysql> SELECT id, name FROM `lbudnik-test` WHERE name LIKE 'Szczech';
+----+---------+
| id | name    |
+----+---------+
|  4 | Szczech |
|  5 | Szczech |
+----+---------+
2 rows in set (0.00 sec)

mysql> SELECT id, name FROM `lbudnik-test` WHERE name = 'Szczech';
+----+---------+
| id | name    |
+----+---------+
|  4 | Szczech |
|  5 | Szczech |
+----+---------+
2 rows in set (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.0.16-nt |
+-----------+
1 row in set (0.00 sec)

-- 
-jp


If you can see Chuck Norris, he can see you. If you can't see Chuck Norris
you may be only seconds away from death.

Thread
name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik31 May
  • Need help querying a database of polynomialsLew E. Lefton31 May
    • Re: Need help querying a database of polynomialsPeter Brawley31 May
      • Re: Need help querying a database of polynomialsPooly31 May
      • Re: Need help querying a database of polynomialsMichael Stassen1 Jun
  • Re: name 'Szczech' returns more rows then 'Szczec%'sheeri kritzer31 May
    • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik31 May
      • Re: name 'Szczech' returns more rows then 'Szczec%'Jake Peavy1 Jun
        • Re: name 'Szczech' returns more rows then 'Szczec%'Brendan Bouffler1 Jun
          • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
            • Re: name 'Szczech' returns more rows then 'Szczec%'Jake Peavy1 Jun
  • Re: name 'Szczech' returns more rows then 'Szczec%'Remo Tex1 Jun
    • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
      • Re: name 'Szczech' returns more rows then 'Szczec%'Remo Tex1 Jun
        • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
        • myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')Chris Sansom4 Jun
          • Re: myisamchk (was: name 'Szczech' returns more rows then'Szczec%')Chris Sansom5 Jun
          • Re: myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')gclark5 Jun
            • Re: myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')Chris Sansom8 Jun