summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am2
-rw-r--r--mysql-test/r/alter_table.result10
-rw-r--r--mysql-test/r/ctype_ujis.result40
-rw-r--r--mysql-test/t/alter_table.test12
-rw-r--r--mysql-test/t/ctype_ujis.test36
5 files changed, 99 insertions, 1 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index ad02d304d1b..fcf352f46e6 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -37,7 +37,7 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
INCLUDES = -I$(srcdir)/../include -I../include -I..
-bin_PROGRAMS = mysql_test_run_new
+EXTRA_PROGRAMS = mysql_test_run_new
noinst_HEADERS = my_manage.h
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 89b8bd66848..9e14ca85a29 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -483,3 +483,13 @@ ERROR 42000: Incorrect table name 't1\\'
rename table t1 to `t1\\`;
ERROR 42000: Incorrect table name 't1\\'
drop table t1;
+create table t1 (a text) character set koi8r;
+insert into t1 values (_koi8r'ΤΕΣΤ');
+select hex(a) from t1;
+hex(a)
+D4C5D3D4
+alter table t1 convert to character set cp1251;
+select hex(a) from t1;
+hex(a)
+F2E5F1F2
+drop table t1;
diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result
index 7c3ae52cbc9..d02ac0062f8 100644
--- a/mysql-test/r/ctype_ujis.result
+++ b/mysql-test/r/ctype_ujis.result
@@ -126,3 +126,43 @@ Field Type Null Key Default Extra
a char(1)
b enum('€’','€€') YES NULL
DROP TABLE t1;
+CREATE TABLE t1
+(
+a INTEGER NOT NULL,
+b VARCHAR(50) NOT NULL DEFAULT '',
+PRIMARY KEY (a),
+KEY b (b(10))
+) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
+INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
+INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
+INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
+SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
+a b
+0 aaabbbcccddd
+SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
+a b
+1 eeefffggghhh
+SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
+a b
+2 iiijjjkkkl
+DROP TABLE t1;
+CREATE TABLE t1
+(
+a INTEGER NOT NULL,
+b VARCHAR(50) NOT NULL DEFAULT '',
+PRIMARY KEY (a),
+KEY b (b(10))
+) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
+INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
+INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
+INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
+SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
+a b
+0 aaabbbcccddd
+SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
+a b
+1 eeefffggghhh
+SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
+a b
+2 iiijjjkkkl
+DROP TABLE t1;
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index e46027ae8d9..66a4adc90fe 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -324,3 +324,15 @@ alter table t1 rename to `t1\\`;
rename table t1 to `t1\\`;
drop table t1;
+#
+# Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns
+#
+# The column's character set was changed but the actual data was not
+# modified. In other words, the values were reinterpreted
+# as UTF8 instead of being converted.
+create table t1 (a text) character set koi8r;
+insert into t1 values (_koi8r'ΤΕΣΤ');
+select hex(a) from t1;
+alter table t1 convert to character set cp1251;
+select hex(a) from t1;
+drop table t1;
diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test
index e5405d9f1bd..9cfb6b14d7e 100644
--- a/mysql-test/t/ctype_ujis.test
+++ b/mysql-test/t/ctype_ujis.test
@@ -83,3 +83,39 @@ CREATE TABLE t1 (
SHOW CREATE TABLE t1;
SHOW COLUMNS FROM t1;
DROP TABLE t1;
+
+#
+# Bug #6345 Unexpected behaviour with partial indices
+#
+--disable_warnings
+CREATE TABLE t1
+(
+ a INTEGER NOT NULL,
+ b VARCHAR(50) NOT NULL DEFAULT '',
+ PRIMARY KEY (a),
+ KEY b (b(10))
+) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
+--enable_warnings
+INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
+INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
+INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
+SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
+SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
+SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
+DROP TABLE t1;
+--disable_warnings
+CREATE TABLE t1
+(
+ a INTEGER NOT NULL,
+ b VARCHAR(50) NOT NULL DEFAULT '',
+ PRIMARY KEY (a),
+ KEY b (b(10))
+) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
+--enable_warnings
+INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
+INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
+INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
+SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
+SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
+SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
+DROP TABLE t1;