aurelian (owner)

Revisions

gist: 135225 Download_button fork
public
Public Clone URL: git://gist.github.com/135225.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mysql> create table `tm` ( `name` varchar(255), primary key (`name`)) engine=InnoDB default charset=utf8;
Query OK, 0 rows affected (1.18 sec)
 
mysql> insert into tm values ('București');
Query OK, 1 row affected (0.01 sec)
 
mysql> insert into tm values ('Bucuresti');
ERROR 1062 (23000): Duplicate entry 'Bucuresti' for key 1
 
mysql> delete from tm;
Query OK, 1 row affected (0.00 sec)
 
mysql> alter table tm modify `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Query OK, 0 rows affected (0.46 sec)
Records: 0 Duplicates: 0 Warnings: 0
 
mysql> insert into tm values ('București');
Query OK, 1 row affected (0.01 sec)
 
mysql> insert into tm values ('Bucuresti');
ERROR 1062 (23000): Duplicate entry 'Bucuresti' for key 1
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
mysql> create table `tm` (
  `id` int(11) auto_increment,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci,
   primary key (`id`))
engine=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci default charset=utf8;
Query OK, 0 rows affected (0.36 sec)
 
mysql> insert into tm (`name`) values ('București');
Query OK, 1 row affected (0.05 sec)
 
mysql> insert into tm (`name`) values ('Bucuresti');
Query OK, 1 row affected (0.00 sec)
 
mysql> select * from tm where name='Bucuresti'\G
*************************** 1. row ***************************
  id: 1
name: București
*************************** 2. row ***************************
  id: 2
name: Bucuresti
2 rows in set (0.00 sec)