mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-global-4.1 sql/sql_class.h: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged
This commit is contained in:
7
mysql-test/include/endspace.inc
Normal file
7
mysql-test/include/endspace.inc
Normal file
@ -0,0 +1,7 @@
|
||||
select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
|
||||
select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
|
||||
select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
|
||||
select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
|
||||
select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
|
||||
select 'a a' > 'a', 'a \0' < 'a';
|
||||
select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
|
@ -1387,13 +1387,18 @@ run_testcase ()
|
||||
# script soon anyway so it is not worth it spending the time
|
||||
if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then
|
||||
for t in \
|
||||
"alter_table" \
|
||||
"bdb-deadlock" \
|
||||
"connect" \
|
||||
"ctype_latin1_de" \
|
||||
"ctype_ucs" \
|
||||
"flush_block_commit" \
|
||||
"grant2" \
|
||||
"grant_cache" \
|
||||
"grant" \
|
||||
"init_connect" \
|
||||
"init_file" \
|
||||
"innodb" \
|
||||
"innodb-deadlock" \
|
||||
"innodb-lock" \
|
||||
"mix_innodb_myisam_binlog" \
|
||||
@ -1401,10 +1406,12 @@ run_testcase ()
|
||||
"mysqlbinlog" \
|
||||
"mysqldump" \
|
||||
"mysql_protocols" \
|
||||
"packet" \
|
||||
"ps_1general" \
|
||||
"rename" \
|
||||
"show_check" \
|
||||
"system_mysql_db_fix" \
|
||||
"timezone2" \
|
||||
"user_var" \
|
||||
"variables"
|
||||
do
|
||||
|
58
mysql-test/r/ctype_big5.result.es
Normal file
58
mysql-test/r/ctype_big5.result.es
Normal file
@ -0,0 +1,58 @@
|
||||
drop table if exists t1;
|
||||
SET @test_character_set= 'big5';
|
||||
SET @test_collation= 'big5_chinese_ci';
|
||||
SET @safe_character_set_server= @@character_set_server;
|
||||
SET @safe_collation_server= @@collation_server;
|
||||
SET character_set_server= @test_character_set;
|
||||
SET collation_server= @test_collation;
|
||||
CREATE DATABASE d1;
|
||||
USE d1;
|
||||
CREATE TABLE t1 (c CHAR(10), KEY(c));
|
||||
SHOW FULL COLUMNS FROM t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
c char(10) big5_chinese_ci YES MUL NULL
|
||||
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
|
||||
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
|
||||
want3results
|
||||
aaa
|
||||
aaaa
|
||||
aaaaa
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
|
||||
SHOW FULL COLUMNS FROM t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
c1 varchar(15) big5_chinese_ci YES MUL NULL
|
||||
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
|
||||
SELECT c1 as want3results from t1 where c1 like 'l%';
|
||||
want3results
|
||||
location
|
||||
loberge
|
||||
lotre
|
||||
SELECT c1 as want3results from t1 where c1 like 'lo%';
|
||||
want3results
|
||||
location
|
||||
loberge
|
||||
lotre
|
||||
SELECT c1 as want1result from t1 where c1 like 'loc%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'loca%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locat%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locati%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locatio%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
want1result
|
||||
location
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
SET collation_server= @safe_collation_server;
|
242
mysql-test/r/ctype_recoding.result.es
Normal file
242
mysql-test/r/ctype_recoding.result.es
Normal file
@ -0,0 +1,242 @@
|
||||
SET CHARACTER SET koi8r;
|
||||
DROP TABLE IF EXISTS <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t1, t2;
|
||||
SET CHARACTER SET koi8r;
|
||||
CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'<27><><EFBFBD><EFBFBD><EFBFBD>' AS a;
|
||||
CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(10) character set cp1251 default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT a FROM t1;
|
||||
a
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT HEX(a) FROM t1;
|
||||
HEX(a)
|
||||
EFF0EEE1E0
|
||||
INSERT t2 SELECT * FROM t1;
|
||||
SELECT HEX(a) FROM t2;
|
||||
HEX(a)
|
||||
D0BFD180D0BED0B1D0B0
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (description text character set cp1250 NOT NULL);
|
||||
INSERT INTO t1 (description) VALUES (_latin2'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde');
|
||||
SELECT description FROM t1;
|
||||
description
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'<27><><EFBFBD><EFBFBD><EFBFBD>' AS a;
|
||||
CREATE TABLE t2 (a TEXT CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text character set cp1251
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT HEX(a) FROM t1;
|
||||
HEX(a)
|
||||
EFF0EEE1E0
|
||||
INSERT t2 SELECT * FROM t1;
|
||||
SELECT HEX(a) FROM t2;
|
||||
HEX(a)
|
||||
D0BFD180D0BED0B1D0B0
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE `<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>`
|
||||
(
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
) COMMENT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SHOW CREATE TABLE <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Table Create Table
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CREATE TABLE `<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>` (
|
||||
`<EFBFBD><EFBFBD><EFBFBD><EFBFBD>` char(32) character set koi8r NOT NULL default '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
SHOW FIELDS FROM <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Field Type Null Key Default Extra
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> char(32)
|
||||
SET CHARACTER SET cp1251;
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SHOW CREATE TABLE <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Table Create Table
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CREATE TABLE `<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>` (
|
||||
`<EFBFBD><EFBFBD><EFBFBD><EFBFBD>` char(32) character set koi8r NOT NULL default '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
SHOW FIELDS FROM <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Field Type Null Key Default Extra
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> char(32)
|
||||
SET CHARACTER SET utf8;
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
таблица
|
||||
SHOW CREATE TABLE таблица;
|
||||
Table Create Table
|
||||
таблица CREATE TABLE `таблица` (
|
||||
`поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий поля'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы'
|
||||
SHOW FIELDS FROM таблица;
|
||||
Field Type Null Key Default Extra
|
||||
поле char(32)
|
||||
SET CHARACTER SET koi8r;
|
||||
DROP TABLE <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
SET CHARACTER SET default;
|
||||
SET NAMES UTF8;
|
||||
CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8;
|
||||
INSERT INTO t1 (t) VALUES ('x');
|
||||
SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
SET CHARACTER SET koi8r;
|
||||
CREATE DATABASE <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
USE <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
SHOW TABLES;
|
||||
Tables_in_тест
|
||||
SHOW TABLES IN <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Tables_in_тест
|
||||
SET CHARACTER SET cp1251;
|
||||
SHOW TABLES;
|
||||
Tables_in_тест
|
||||
SHOW TABLES IN <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Tables_in_тест
|
||||
SET CHARACTER SET koi8r;
|
||||
DROP DATABASE <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
SET NAMES koi8r;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
hex('тест')
|
||||
D4C5D3D4
|
||||
SET character_set_connection=cp1251;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
hex('тест')
|
||||
F2E5F1F2
|
||||
USE test;
|
||||
SET NAMES binary;
|
||||
CREATE TABLE `тест` (`тест` int);
|
||||
SHOW CREATE TABLE `тест`;
|
||||
Table Create Table
|
||||
тест CREATE TABLE `тест` (
|
||||
`тест` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SET NAMES utf8;
|
||||
SHOW CREATE TABLE `тест`;
|
||||
Table Create Table
|
||||
тест CREATE TABLE `тест` (
|
||||
`тест` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE `тест`;
|
||||
SET NAMES binary;
|
||||
SET character_set_connection=utf8;
|
||||
SELECT 'тест' as s;
|
||||
s
|
||||
тест
|
||||
SET NAMES utf8;
|
||||
SET character_set_connection=binary;
|
||||
SELECT 'тест' as s;
|
||||
s
|
||||
тест
|
||||
SET NAMES latin1;
|
||||
CREATE TABLE t1 (`<EFBFBD>` CHAR(128) DEFAULT '<27>', `<EFBFBD>1` ENUM('<27>1','<27>2') DEFAULT '<27>2');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`<EFBFBD>` char(128) default '<27>',
|
||||
`<EFBFBD>1` enum('<27>1','<27>2') default '<27>2'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SHOW COLUMNS FROM t1;
|
||||
Field Type Null Key Default Extra
|
||||
<EFBFBD> char(128) YES <EFBFBD>
|
||||
<EFBFBD>1 enum('<27>1','<27>2') YES <EFBFBD>2
|
||||
SET NAMES binary;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`ä` char(128) default 'ä',
|
||||
`ä1` enum('ä1','ä2') default 'ä2'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SHOW COLUMNS FROM t1;
|
||||
Field Type Null Key Default Extra
|
||||
ä char(128) YES ä
|
||||
ä1 enum('ä1','ä2') YES ä2
|
||||
DROP TABLE t1;
|
||||
SET NAMES binary;
|
||||
CREATE TABLE `good<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>` (a int);
|
||||
ERROR HY000: Invalid utf8 character string: '<27><><EFBFBD><EFBFBD><EFBFBD>'
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE `good<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>` (a int);
|
||||
ERROR HY000: Invalid utf8 character string: '<27><><EFBFBD><EFBFBD><EFBFBD>` (a int)'
|
||||
set names latin1;
|
||||
create table t1 (a char(10) character set koi8r, b text character set koi8r);
|
||||
insert into t1 values ('test','test');
|
||||
insert into t1 values ('<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>');
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
Warning 1265 Data truncated for column 'b' at row 1
|
||||
drop table t1;
|
||||
set names koi8r;
|
||||
create table t1 (a char(10) character set cp1251);
|
||||
insert into t1 values (_koi8r'<27><><EFBFBD><EFBFBD>');
|
||||
select * from t1 where a=_koi8r'<27><><EFBFBD><EFBFBD>';
|
||||
a
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
select * from t1 where a=concat(_koi8r'<27><><EFBFBD><EFBFBD>');
|
||||
ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '='
|
||||
select * from t1 where a=_latin1'<27><><EFBFBD><EFBFBD>';
|
||||
ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
|
||||
drop table t1;
|
||||
set names latin1;
|
||||
set names koi8r;
|
||||
create table t1 (c1 char(10) character set cp1251);
|
||||
insert into t1 values ('<27>');
|
||||
select c1 from t1 where c1 between '<27>' and '<27>';
|
||||
c1
|
||||
<EFBFBD>
|
||||
select ifnull(c1,'<27>'), ifnull(null,c1) from t1;
|
||||
ifnull(c1,'ъ') ifnull(null,c1)
|
||||
<EFBFBD> <EFBFBD>
|
||||
select if(1,c1,'<27>'), if(0,c1,'<27>') from t1;
|
||||
if(1,c1,'Ж') if(0,c1,'Ж')
|
||||
<EFBFBD> <EFBFBD>
|
||||
select coalesce('<27>',c1), coalesce(null,c1) from t1;
|
||||
coalesce('Ж',c1) coalesce(null,c1)
|
||||
<EFBFBD> <EFBFBD>
|
||||
select least(c1,'<27>'), greatest(c1,'<27>') from t1;
|
||||
least(c1,'Ж') greatest(c1,'Ж')
|
||||
<EFBFBD> <EFBFBD>
|
||||
select locate(c1,'<27>'), locate('<27>',c1) from t1;
|
||||
locate(c1,'ъ') locate('ъ',c1)
|
||||
1 1
|
||||
select field(c1,'<27>'),field('<27>',c1) from t1;
|
||||
field(c1,'ъ') field('ъ',c1)
|
||||
1 1
|
||||
select concat(c1,'<27>'), concat('<27>',c1) from t1;
|
||||
concat(c1,'Ж') concat('Ж',c1)
|
||||
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
||||
select concat_ws(c1,'<27>','<27>'), concat_ws('<27>',c1,'<27>') from t1;
|
||||
concat_ws(c1,'Ж','ъ') concat_ws('Ж',c1,'ъ')
|
||||
<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
||||
select replace(c1,'<27>','<27>'), replace('<27>',c1,'<27>') from t1;
|
||||
replace(c1,'ъ','Ж') replace('ъ',c1,'Ж')
|
||||
<EFBFBD> <EFBFBD>
|
||||
select substring_index(c1,'<27><><EFBFBD><EFBFBD>',2) from t1;
|
||||
substring_index(c1,'ЖЖъъ',2)
|
||||
<EFBFBD>
|
||||
select elt(1,c1,'<27>'),elt(1,'<27>',c1) from t1;
|
||||
elt(1,c1,'Ж') elt(1,'Ж',c1)
|
||||
<EFBFBD> <EFBFBD>
|
||||
select make_set(3,c1,'<27>'), make_set(3,'<27>',c1) from t1;
|
||||
make_set(3,c1,'Ж') make_set(3,'Ж',c1)
|
||||
<EFBFBD>,<EFBFBD> <EFBFBD>,<EFBFBD>
|
||||
select insert(c1,1,2,'<27>'),insert('<27>',1,2,c1) from t1;
|
||||
insert(c1,1,2,'Ж') insert('Ж',1,2,c1)
|
||||
<EFBFBD> <EFBFBD>
|
||||
select trim(c1 from '<27>'),trim('<27>' from c1) from t1;
|
||||
trim(c1 from 'ъ') trim('ъ' from c1)
|
||||
|
||||
select lpad(c1,3,'<27>'), lpad('<27>',3,c1) from t1;
|
||||
lpad(c1,3,'Ж') lpad('Ж',3,c1)
|
||||
<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
||||
select rpad(c1,3,'<27>'), rpad('<27>',3,c1) from t1;
|
||||
rpad(c1,3,'Ж') rpad('Ж',3,c1)
|
||||
<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
2377
mysql-test/r/ctype_uca.result.es
Normal file
2377
mysql-test/r/ctype_uca.result.es
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,27 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
SET NAMES latin1;
|
||||
SET character_set_connection=ucs2;
|
||||
select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
|
||||
'a' = 'a' 'a' = 'a ' 'a ' = 'a'
|
||||
1 1 1
|
||||
select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
|
||||
'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a'
|
||||
0 1 0
|
||||
select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
|
||||
'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0'
|
||||
0 0 1
|
||||
select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
|
||||
'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a '
|
||||
0 1 0
|
||||
select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
|
||||
'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0'
|
||||
0 0 1
|
||||
select 'a a' > 'a', 'a \0' < 'a';
|
||||
'a a' > 'a' 'a \0' < 'a'
|
||||
1 1
|
||||
select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
|
||||
binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a'
|
||||
1 1 1
|
||||
SET CHARACTER SET koi8r;
|
||||
CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES (_koi8r'<27>'), (X'2004');
|
||||
|
@ -11,8 +11,8 @@ get_lock("a",10)
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
|
||||
master-bin.000001 79 Query 1 79 use `test`; create database `drop-temp+table-test`
|
||||
master-bin.000001 152 Query 1 152 use `drop-temp+table-test`; create temporary table `table:name` (a int)
|
||||
master-bin.000001 246 Query 1 246 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name`
|
||||
master-bin.000001 375 Query 1 375 use `drop-temp+table-test`; DO RELEASE_LOCK("a")
|
||||
master-bin.000001 79 Query 1 79 create database `drop-temp+table-test`
|
||||
master-bin.000001 168 Query 1 168 use `drop-temp+table-test`; create temporary table `table:name` (a int)
|
||||
master-bin.000001 262 Query 1 262 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name`
|
||||
master-bin.000001 391 Query 1 391 use `drop-temp+table-test`; DO RELEASE_LOCK("a")
|
||||
drop database `drop-temp+table-test`;
|
||||
|
185
mysql-test/r/func_test.result.es
Normal file
185
mysql-test/r/func_test.result.es
Normal file
@ -0,0 +1,185 @@
|
||||
drop table if exists t1,t2;
|
||||
select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ;
|
||||
0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a")
|
||||
1 1 1 0 0 1 -1 1 0
|
||||
select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b";
|
||||
"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b"
|
||||
1 1 1 1 1 1
|
||||
select "a "="A", "A "="a", "a " <= "A b";
|
||||
"a "="A" "A "="a" "a " <= "A b"
|
||||
1 1 1
|
||||
select "abc" like "a%", "abc" not like "%d%", "a%" like "a\%","abc%" like "a%\%","abcd" like "a%b_%d", "a" like "%%a","abcde" like "a%_e","abc" like "abc%";
|
||||
"abc" like "a%" "abc" not like "%d%" "a%" like "a\%" "abc%" like "a%\%" "abcd" like "a%b_%d" "a" like "%%a" "abcde" like "a%_e" "abc" like "abc%"
|
||||
1 1 1 1 1 1 1 1
|
||||
select "a" like "%%b","a" like "%%ab","ab" like "a\%", "ab" like "_", "ab" like "ab_", "abc" like "%_d", "abc" like "abc%d";
|
||||
"a" like "%%b" "a" like "%%ab" "ab" like "a\%" "ab" like "_" "ab" like "ab_" "abc" like "%_d" "abc" like "abc%d"
|
||||
0 0 0 0 0 0 0
|
||||
select '?' like '|%', '?' like '|%' ESCAPE '|', '%' like '|%', '%' like '|%' ESCAPE '|', '%' like '%';
|
||||
'?' like '|%' '?' like '|%' ESCAPE '|' '%' like '|%' '%' like '|%' ESCAPE '|' '%' like '%'
|
||||
0 0 0 1 1
|
||||
select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" like "ab";
|
||||
'abc' like '%c' 'abcabc' like '%c' "ab" like "" "ab" like "a" "ab" like "ab"
|
||||
1 1 0 0 1
|
||||
select "Det h<>r <20>r svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$";
|
||||
"Det här är svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$"
|
||||
1 1
|
||||
select "aba" regexp concat("^","a");
|
||||
"aba" regexp concat("^","a")
|
||||
1
|
||||
select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0;
|
||||
!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0
|
||||
1 1 0 1 0 1 1 1
|
||||
select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3;
|
||||
2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3
|
||||
1 1 1
|
||||
select 'b' between 'a' and 'c', 'B' between 'a' and 'c';
|
||||
'b' between 'a' and 'c' 'B' between 'a' and 'c'
|
||||
1 1
|
||||
select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0);
|
||||
2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0)
|
||||
1 1 1
|
||||
select -1.49 or -1.49,0.6 or 0.6;
|
||||
-1.49 or -1.49 0.6 or 0.6
|
||||
1 1
|
||||
select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
|
||||
3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1
|
||||
8 0 1 NULL NULL
|
||||
explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1`
|
||||
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
|
||||
1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
|
||||
0 1 1 0 NULL NULL NULL
|
||||
select 1 like 2 xor 2 like 1;
|
||||
1 like 2 xor 2 like 1
|
||||
0
|
||||
select 10 % 7, 10 mod 7, 10 div 3;
|
||||
10 % 7 10 mod 7 10 div 3
|
||||
3 3 3
|
||||
explain extended select 10 % 7, 10 mod 7, 10 div 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3`
|
||||
select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
|
||||
(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2
|
||||
18446744073709551615 18446744073709551615 9223372036854775807
|
||||
explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2`
|
||||
create table t1 (a int);
|
||||
insert t1 values (1);
|
||||
select * from t1 where 1 xor 1;
|
||||
a
|
||||
explain extended select * from t1 where 1 xor 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1)
|
||||
select - a from t1;
|
||||
- a
|
||||
-1
|
||||
explain extended select - a from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
||||
Warnings:
|
||||
Note 1003 select -(test.t1.a) AS `- a` from test.t1
|
||||
drop table t1;
|
||||
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
|
||||
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
|
||||
0 1
|
||||
select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1;
|
||||
1 and 2 between 2 and 10 2 between 2 and 10 and 1
|
||||
1 1
|
||||
select 1 and 0 or 2, 2 or 1 and 0;
|
||||
1 and 0 or 2 2 or 1 and 0
|
||||
1 1
|
||||
select _koi8r'a' = _koi8r'A';
|
||||
_koi8r'a' = _koi8r'A'
|
||||
1
|
||||
select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci;
|
||||
_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci
|
||||
1
|
||||
explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci`
|
||||
select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin;
|
||||
_koi8r'a' = _koi8r'A' COLLATE koi8r_bin
|
||||
0
|
||||
select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A';
|
||||
_koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'
|
||||
1
|
||||
select _koi8r'a' COLLATE koi8r_bin = _koi8r'A';
|
||||
_koi8r'a' COLLATE koi8r_bin = _koi8r'A'
|
||||
0
|
||||
select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci;
|
||||
ERROR HY000: Illegal mix of collations (koi8r_bin,EXPLICIT) and (koi8r_general_ci,EXPLICIT) for operation '='
|
||||
select _koi8r'a' = _latin1'A';
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
|
||||
select strcmp(_koi8r'a', _koi8r'A');
|
||||
strcmp(_koi8r'a', _koi8r'A')
|
||||
0
|
||||
select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci);
|
||||
strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci)
|
||||
0
|
||||
select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin);
|
||||
strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin)
|
||||
1
|
||||
select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A');
|
||||
strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A')
|
||||
0
|
||||
select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A');
|
||||
strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A')
|
||||
1
|
||||
select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin);
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'strcmp'
|
||||
select strcmp(_koi8r'a', _latin1'A');
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'strcmp'
|
||||
select _koi8r'a' LIKE _koi8r'A';
|
||||
_koi8r'a' LIKE _koi8r'A'
|
||||
1
|
||||
select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci;
|
||||
_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci
|
||||
1
|
||||
select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin;
|
||||
_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin
|
||||
0
|
||||
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A';
|
||||
_koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'
|
||||
1
|
||||
select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A';
|
||||
_koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'
|
||||
0
|
||||
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin;
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like'
|
||||
select _koi8r'a' LIKE _latin1'A';
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like'
|
||||
CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','<as-html>\r\n<table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"><3E></td>\r\n <td width=\"97%\">\r\n <h3><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000000\">How \r\n To</font><!-- #BeginEditable \"CS_troubleshoot_question\" --><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000099\"><font color=\"#000000\">: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected. </font></font><!-- #EndEditable --></h3>\r\n </td>\r\n </tr>\r\n</table>','<as-html>\r\n <table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"><3E></td>\r\n \r\n<td width=\"97%\"><!-- #BeginEditable \"CS_troubleshoot_answer\" --> \r\n \r\n<p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">1. Select \r\n the <i>On/Setup</i> button to access the DynaVox Setup Menu.<br>\r\n 2. Select <b>Button Features.</b><br>\r\n 3. Below the <b>OK</b> button is the <b>Usage Counts</b> button.<br>\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.<br>\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.<br>\r\n c. Select the <b>Usage Counts</b> Option Ring once and it will toggle \r\n to the alternative option.<br>\r\n 4. Once the correct setting has been chosen, select <b>OK</b> to leave the <i>Button \r\n Features</i> menu.<br>\r\n 5. Select <b>OK</b> out of the <i>Setup</i> menu and return to the communication \r\n page.</font></p>\r\n <p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">For \r\n further information on <i>Usage Counts,</i> see the <i>Button Features \r\n Menu Entry</i> in the DynaVox/DynaMyte Reference Manual.</font></p>\r\n<!-- #EndEditable --></td>\r\n </tr>\r\n</table>',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL);
|
||||
CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1);
|
||||
SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank;
|
||||
rank rank rank
|
||||
2 2 NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (d varchar(6), k int);
|
||||
INSERT INTO t1 VALUES (NULL, 2);
|
||||
SELECT GREATEST(d,d) FROM t1 WHERE k=2;
|
||||
GREATEST(d,d)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
select 1197.90 mod 50;
|
||||
1197.90 mod 50
|
||||
47.90
|
||||
select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
|
||||
5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3
|
||||
2.1 2.1 -2.1 -2.1
|
||||
select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
|
||||
5 mod 3 5 mod -3 -5 mod 3 -5 mod -3
|
||||
2 2 -2 -2
|
@ -321,3 +321,23 @@ DROP DATABASE testdb7;
|
||||
DROP DATABASE testdb8;
|
||||
DROP DATABASE testdb9;
|
||||
DROP DATABASE testdb10;
|
||||
create table t1(a int, b int, c int, d int);
|
||||
grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
|
||||
show grants for grant_user@localhost;
|
||||
Grants for grant_user@localhost
|
||||
GRANT USAGE ON *.* TO 'grant_user'@'localhost'
|
||||
GRANT INSERT (a, d, c, b) ON `test`.`t1` TO 'grant_user'@'localhost'
|
||||
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
|
||||
Host Db User Table_name Column_name Column_priv
|
||||
localhost test grant_user t1 c Insert
|
||||
localhost test grant_user t1 b Insert
|
||||
localhost test grant_user t1 a Insert
|
||||
localhost test grant_user t1 d Insert
|
||||
revoke ALL PRIVILEGES on t1 from grant_user@localhost;
|
||||
show grants for grant_user@localhost;
|
||||
Grants for grant_user@localhost
|
||||
GRANT USAGE ON *.* TO 'grant_user'@'localhost'
|
||||
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
|
||||
Host Db User Table_name Column_name Column_priv
|
||||
drop user grant_user@localhost;
|
||||
drop table t1;
|
||||
|
@ -240,3 +240,12 @@ SELECT * FROM t1;
|
||||
pseudo date
|
||||
ZoomZip 1101106546
|
||||
DROP TABLE t1;
|
||||
create table t1(a char(2)) engine=memory;
|
||||
insert into t1 values (NULL), (NULL);
|
||||
delete from t1 where a is null;
|
||||
insert into t1 values ('2'), ('3');
|
||||
select * from t1;
|
||||
a
|
||||
3
|
||||
2
|
||||
drop table t1;
|
||||
|
1653
mysql-test/r/innodb.result.es
Normal file
1653
mysql-test/r/innodb.result.es
Normal file
File diff suppressed because it is too large
Load Diff
@ -81,6 +81,15 @@ a
|
||||
1
|
||||
2
|
||||
drop table t1, t2;
|
||||
create table t1(a int);
|
||||
insert into t1 values(1),(1);
|
||||
reset master;
|
||||
create table t2(unique(a)) select a from t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
|
||||
drop table t1;
|
||||
create table t1 (a int not null);
|
||||
create table t2 (a int not null);
|
||||
insert into t1 values (1);
|
||||
|
@ -6,5 +6,5 @@ drop table t1;
|
||||
flush tables;
|
||||
CREATE TABLE t1 (a int) ENGINE=INNODB;
|
||||
SELECT * from T1;
|
||||
ERROR HY000: Can't open file: 'T1.InnoDB' (errno: 1)
|
||||
ERROR HY000: Can't open file: 'T1.ibd' (errno: 1)
|
||||
drop table t1;
|
||||
|
59
mysql-test/r/myisam-blob.result.es
Normal file
59
mysql-test/r/myisam-blob.result.es
Normal file
@ -0,0 +1,59 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
|
||||
INSERT INTO t1 (data) VALUES (NULL);
|
||||
UPDATE t1 set data=repeat('a',18*1024*1024);
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
|
||||
select length(data) from t1;
|
||||
length(data)
|
||||
NULL
|
||||
delete from t1 where left(data,1)='a';
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
truncate table t1;
|
||||
INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
|
||||
INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
|
||||
delete from t1 where left(data,1)='b';
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
UPDATE t1 set data=repeat('c',17*1024*1024);
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
delete from t1 where left(data,1)='c';
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
INSERT INTO t1 set data=repeat('a',18*1024*1024);
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
|
||||
select length(data) from t1;
|
||||
length(data)
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
alter table t1 modify data blob;
|
||||
select length(data) from t1;
|
||||
length(data)
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (data BLOB) ENGINE=myisam;
|
||||
INSERT INTO t1 (data) VALUES (NULL);
|
||||
UPDATE t1 set data=repeat('a',18*1024*1024);
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
|
||||
select length(data) from t1;
|
||||
length(data)
|
||||
NULL
|
||||
drop table t1;
|
@ -189,3 +189,13 @@ p a
|
||||
5 aaa
|
||||
6 AAA
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
a varchar(10) primary key
|
||||
) engine=ndb;
|
||||
insert into t1 values ('jonas % ');
|
||||
replace into t1 values ('jonas % ');
|
||||
replace into t1 values ('jonas % ');
|
||||
select * from t1;
|
||||
a
|
||||
jonas %
|
||||
drop table t1;
|
||||
|
3130
mysql-test/r/ps_2myisam.result.es
Normal file
3130
mysql-test/r/ps_2myisam.result.es
Normal file
File diff suppressed because it is too large
Load Diff
3113
mysql-test/r/ps_3innodb.result.es
Normal file
3113
mysql-test/r/ps_3innodb.result.es
Normal file
File diff suppressed because it is too large
Load Diff
3114
mysql-test/r/ps_4heap.result.es
Normal file
3114
mysql-test/r/ps_4heap.result.es
Normal file
File diff suppressed because it is too large
Load Diff
6064
mysql-test/r/ps_5merge.result.es
Normal file
6064
mysql-test/r/ps_5merge.result.es
Normal file
File diff suppressed because it is too large
Load Diff
3113
mysql-test/r/ps_6bdb.result.es
Normal file
3113
mysql-test/r/ps_6bdb.result.es
Normal file
File diff suppressed because it is too large
Load Diff
@ -791,6 +791,19 @@ Qcache_queries_in_cache 1
|
||||
unlock table;
|
||||
drop table t1,t2;
|
||||
set query_cache_wlock_invalidate=default;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY);
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
id
|
||||
1
|
||||
2
|
||||
3
|
||||
create temporary table t1 (a int not null auto_increment
|
||||
primary key);
|
||||
select * from t1;
|
||||
a
|
||||
drop table t1;
|
||||
drop table t1;
|
||||
SET NAMES koi8r;
|
||||
CREATE TABLE t1 (a char(1) character set koi8r);
|
||||
INSERT INTO t1 VALUES (_koi8r'<27>'),(_koi8r'<27>');
|
||||
@ -901,6 +914,8 @@ set group_concat_max_len=10;
|
||||
select group_concat(a) FROM t1 group by b;
|
||||
group_concat(a)
|
||||
1234567890
|
||||
Warnings:
|
||||
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
|
||||
set group_concat_max_len=1024;
|
||||
select group_concat(a) FROM t1 group by b;
|
||||
group_concat(a)
|
||||
|
@ -105,62 +105,62 @@ drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; drop database if exists mysqltest2
|
||||
master-bin.000001 148 Query 1 148 use `test`; drop database if exists mysqltest3
|
||||
master-bin.000001 217 Query 1 217 use `test`; create database mysqltest2 character set latin2
|
||||
master-bin.000001 299 Query 1 299 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
|
||||
master-bin.000001 433 Query 1 433 use `test`; create database mysqltest3
|
||||
master-bin.000001 494 Query 1 494 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||||
master-bin.000001 628 Query 1 628 use `test`; drop database mysqltest3
|
||||
master-bin.000001 687 Query 1 687 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||||
master-bin.000001 821 Query 1 821 use `test`; create database mysqltest3
|
||||
master-bin.000001 882 Query 1 882 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1022 Query 1 1022 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
|
||||
master-bin.000001 1129 Query 1 1129 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1270 Intvar 1 1270 INSERT_ID=1
|
||||
master-bin.000001 1298 Query 1 1298 use `mysqltest2`; insert into t1 (b) values(@@character_set_server)
|
||||
master-bin.000001 1388 Query 1 1388 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1529 Intvar 1 1529 INSERT_ID=2
|
||||
master-bin.000001 1557 Query 1 1557 use `mysqltest2`; insert into t1 (b) values(@@collation_server)
|
||||
master-bin.000001 1643 Query 1 1643 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1784 Intvar 1 1784 INSERT_ID=3
|
||||
master-bin.000001 1812 Query 1 1812 use `mysqltest2`; insert into t1 (b) values(@@character_set_client)
|
||||
master-bin.000001 1902 Query 1 1902 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2043 Intvar 1 2043 INSERT_ID=4
|
||||
master-bin.000001 2071 Query 1 2071 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection)
|
||||
master-bin.000001 2165 Query 1 2165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2306 Intvar 1 2306 INSERT_ID=5
|
||||
master-bin.000001 2334 Query 1 2334 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 2424 Query 1 2424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2564 Query 1 2564 use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 2622 Query 1 2622 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2762 Intvar 1 2762 INSERT_ID=1
|
||||
master-bin.000001 2790 Query 1 2790 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 2880 Query 1 2880 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3020 Intvar 1 3020 INSERT_ID=2
|
||||
master-bin.000001 3048 Query 1 3048 use `mysqltest2`; insert into t1 (b) values(LEAST("M<>ller","Muffler"))
|
||||
master-bin.000001 3141 Query 1 3141 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3282 Intvar 1 3282 INSERT_ID=3
|
||||
master-bin.000001 3310 Query 1 3310 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 3400 Query 1 3400 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3541 Intvar 1 3541 INSERT_ID=4
|
||||
master-bin.000001 3569 Query 1 3569 use `mysqltest2`; insert into t1 (b) values(LEAST("M<>ller","Muffler"))
|
||||
master-bin.000001 3662 Query 1 3662 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3803 Intvar 1 3803 INSERT_ID=74
|
||||
master-bin.000001 3831 Create_file 1 3831 db=mysqltest2;table=t1;file_id=1;block_len=581
|
||||
master-bin.000001 4504 Query 1 4504 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4645 Intvar 1 4645 INSERT_ID=5
|
||||
master-bin.000001 4673 Exec_load 1 4673 ;file_id=1
|
||||
master-bin.000001 4696 Query 1 4696 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4837 Query 1 4837 use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 4895 Query 1 4895 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5036 Intvar 1 5036 INSERT_ID=1
|
||||
master-bin.000001 5064 User var 1 5064 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
|
||||
master-bin.000001 5104 Query 1 5104 use `mysqltest2`; insert into t1 (b) values(collation(@a))
|
||||
master-bin.000001 5185 Query 1 5185 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5326 Query 1 5326 use `mysqltest2`; drop database mysqltest2
|
||||
master-bin.000001 5391 Query 1 5391 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5522 Query 1 5522 drop database mysqltest3
|
||||
master-bin.000001 79 Query 1 79 drop database if exists mysqltest2
|
||||
master-bin.000001 154 Query 1 154 drop database if exists mysqltest3
|
||||
master-bin.000001 229 Query 1 229 create database mysqltest2 character set latin2
|
||||
master-bin.000001 317 Query 1 317 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
|
||||
master-bin.000001 451 Query 1 451 create database mysqltest3
|
||||
master-bin.000001 518 Query 1 518 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||||
master-bin.000001 652 Query 1 652 drop database mysqltest3
|
||||
master-bin.000001 717 Query 1 717 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||||
master-bin.000001 851 Query 1 851 create database mysqltest3
|
||||
master-bin.000001 918 Query 1 918 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1058 Query 1 1058 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
|
||||
master-bin.000001 1165 Query 1 1165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1306 Intvar 1 1306 INSERT_ID=1
|
||||
master-bin.000001 1334 Query 1 1334 use `mysqltest2`; insert into t1 (b) values(@@character_set_server)
|
||||
master-bin.000001 1424 Query 1 1424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1565 Intvar 1 1565 INSERT_ID=2
|
||||
master-bin.000001 1593 Query 1 1593 use `mysqltest2`; insert into t1 (b) values(@@collation_server)
|
||||
master-bin.000001 1679 Query 1 1679 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1820 Intvar 1 1820 INSERT_ID=3
|
||||
master-bin.000001 1848 Query 1 1848 use `mysqltest2`; insert into t1 (b) values(@@character_set_client)
|
||||
master-bin.000001 1938 Query 1 1938 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2079 Intvar 1 2079 INSERT_ID=4
|
||||
master-bin.000001 2107 Query 1 2107 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection)
|
||||
master-bin.000001 2201 Query 1 2201 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2342 Intvar 1 2342 INSERT_ID=5
|
||||
master-bin.000001 2370 Query 1 2370 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 2460 Query 1 2460 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2600 Query 1 2600 use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 2658 Query 1 2658 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2798 Intvar 1 2798 INSERT_ID=1
|
||||
master-bin.000001 2826 Query 1 2826 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 2916 Query 1 2916 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3056 Intvar 1 3056 INSERT_ID=2
|
||||
master-bin.000001 3084 Query 1 3084 use `mysqltest2`; insert into t1 (b) values(LEAST("M<>ller","Muffler"))
|
||||
master-bin.000001 3177 Query 1 3177 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3318 Intvar 1 3318 INSERT_ID=3
|
||||
master-bin.000001 3346 Query 1 3346 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 3436 Query 1 3436 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3577 Intvar 1 3577 INSERT_ID=4
|
||||
master-bin.000001 3605 Query 1 3605 use `mysqltest2`; insert into t1 (b) values(LEAST("M<>ller","Muffler"))
|
||||
master-bin.000001 3698 Query 1 3698 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3839 Intvar 1 3839 INSERT_ID=74
|
||||
master-bin.000001 3867 Create_file 1 3867 db=mysqltest2;table=t1;file_id=1;block_len=581
|
||||
master-bin.000001 4540 Query 1 4540 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4681 Intvar 1 4681 INSERT_ID=5
|
||||
master-bin.000001 4709 Exec_load 1 4709 ;file_id=1
|
||||
master-bin.000001 4732 Query 1 4732 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4873 Query 1 4873 use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 4931 Query 1 4931 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5072 Intvar 1 5072 INSERT_ID=1
|
||||
master-bin.000001 5100 User var 1 5100 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
|
||||
master-bin.000001 5140 Query 1 5140 use `mysqltest2`; insert into t1 (b) values(collation(@a))
|
||||
master-bin.000001 5221 Query 1 5221 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5362 Query 1 5362 drop database mysqltest2
|
||||
master-bin.000001 5427 Query 1 5427 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5558 Query 1 5558 drop database mysqltest3
|
||||
set global character_set_server=latin2;
|
||||
ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
|
||||
set global character_set_server=latin2;
|
||||
@ -200,8 +200,8 @@ hex(c1) hex(c2)
|
||||
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
|
||||
stop slave;
|
||||
delete from t1;
|
||||
change master to master_log_pos=5801;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=5937;
|
||||
change master to master_log_pos=5847;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=5983;
|
||||
start slave;
|
||||
select hex(c1), hex(c2) from t1;
|
||||
hex(c1) hex(c2)
|
||||
|
83
mysql-test/r/rpl_create_database.result
Normal file
83
mysql-test/r/rpl_create_database.result
Normal file
@ -0,0 +1,83 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
DROP DATABASE IF EXISTS mysqltest_prometheus;
|
||||
DROP DATABASE IF EXISTS mysqltest_sisyfos;
|
||||
DROP DATABASE IF EXISTS mysqltest_bob;
|
||||
DROP DATABASE IF EXISTS mysqltest_bob;
|
||||
CREATE DATABASE mysqltest_prometheus;
|
||||
CREATE DATABASE mysqltest_sisyfos;
|
||||
CREATE DATABASE mysqltest_bob;
|
||||
USE mysqltest_sisyfos;
|
||||
CREATE TABLE t1 (b int);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
USE mysqltest_bob;
|
||||
CREATE TABLE t2 (b int);
|
||||
INSERT INTO t2 VALUES(2);
|
||||
ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
|
||||
USE mysqltest_sisyfos;
|
||||
ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
mysql
|
||||
mysqltest_bob
|
||||
mysqltest_prometheus
|
||||
mysqltest_sisyfos
|
||||
test
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
mysql
|
||||
mysqltest_prometheus
|
||||
mysqltest_sisyfos
|
||||
test
|
||||
DROP DATABASE IF EXISTS mysqltest_sisyfos;
|
||||
USE mysqltest_prometheus;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE DATABASE mysqltest_sisyfos;
|
||||
USE mysqltest_sisyfos;
|
||||
CREATE TABLE t2 (a INT);
|
||||
SHOW BINLOG EVENTS;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
|
||||
master-bin.000001 79 Query 1 79 DROP DATABASE IF EXISTS mysqltest_prometheus
|
||||
master-bin.000001 174 Query 1 174 DROP DATABASE IF EXISTS mysqltest_sisyfos
|
||||
master-bin.000001 263 Query 1 263 CREATE DATABASE mysqltest_prometheus
|
||||
master-bin.000001 350 Query 1 350 CREATE DATABASE mysqltest_sisyfos
|
||||
master-bin.000001 431 Query 1 431 use `mysqltest_sisyfos`; CREATE TABLE t1 (b int)
|
||||
master-bin.000001 502 Query 1 502 use `mysqltest_sisyfos`; INSERT INTO t1 VALUES(1)
|
||||
master-bin.000001 574 Query 1 574 ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1
|
||||
master-bin.000001 675 Query 1 675 DROP DATABASE IF EXISTS mysqltest_sisyfos
|
||||
master-bin.000001 764 Query 1 764 use `mysqltest_prometheus`; CREATE TABLE t1 (a INT)
|
||||
master-bin.000001 838 Query 1 838 use `mysqltest_prometheus`; INSERT INTO t1 VALUES (1)
|
||||
master-bin.000001 914 Query 1 914 CREATE DATABASE mysqltest_sisyfos
|
||||
master-bin.000001 995 Query 1 995 use `mysqltest_sisyfos`; CREATE TABLE t2 (a INT)
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
mysql
|
||||
mysqltest_bob
|
||||
mysqltest_prometheus
|
||||
mysqltest_sisyfos
|
||||
test
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
mysql
|
||||
mysqltest_prometheus
|
||||
mysqltest_sisyfos
|
||||
test
|
||||
SHOW CREATE TABLE mysqltest_prometheus.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SHOW CREATE TABLE mysqltest_sisyfos.t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP DATABASE IF EXISTS mysqltest_prometheus;
|
||||
DROP DATABASE IF EXISTS mysqltest_sisyfos;
|
||||
DROP DATABASE IF EXISTS mysqltest_bob;
|
@ -12,4 +12,6 @@ use mysqltest;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 drop database if exists mysqltest
|
||||
master-bin.000001 152 Query 1 152 create database mysqltest
|
||||
drop database mysqltest;
|
||||
|
@ -1,4 +1,5 @@
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
drop table if exists t1_1,t1_2,t9_1,t9_2;
|
||||
CREATE TABLE t1 (
|
||||
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
|
||||
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
|
||||
@ -2056,6 +2057,10 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
|
||||
drop table t4, t3, t2, t1;
|
||||
DO 1;
|
||||
DO benchmark(100,1+1),1,1;
|
||||
do default;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||
do foobar;
|
||||
ERROR 42S22: Unknown column 'foobar' in 'field list'
|
||||
CREATE TABLE t1 (
|
||||
id mediumint(8) unsigned NOT NULL auto_increment,
|
||||
pseudo varchar(35) NOT NULL default '',
|
||||
@ -2348,6 +2353,27 @@ select * from t2,t3 where t2.s = t3.s;
|
||||
s s
|
||||
two two
|
||||
drop table t1, t2, t3;
|
||||
create table t1 (a integer, b integer, index(a), index(b));
|
||||
create table t2 (c integer, d integer, index(c), index(d));
|
||||
insert into t1 values (1,2), (2,2), (3,2), (4,2);
|
||||
insert into t2 values (1,3), (2,3), (3,4), (4,4);
|
||||
explain select * from t1 left join t2 on a=c where d in (4);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref c,d d 5 const 2 Using where
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where
|
||||
select * from t1 left join t2 on a=c where d in (4);
|
||||
a b c d
|
||||
3 2 3 4
|
||||
4 2 4 4
|
||||
explain select * from t1 left join t2 on a=c where d = 4;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref c,d d 5 const 2 Using where
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where
|
||||
select * from t1 left join t2 on a=c where d = 4;
|
||||
a b c d
|
||||
3 2 3 4
|
||||
4 2 4 4
|
||||
drop table t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL default '0',
|
||||
c char(10) NOT NULL default '',
|
||||
@ -2360,7 +2386,4 @@ INSERT INTO t1 VALUES (3,'c');
|
||||
EXPLAIN SELECT i FROM t1 WHERE i=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
EXPLAIN SELECT i FROM t1 WHERE i=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
DROP TABLE t1;
|
||||
|
@ -684,8 +684,8 @@ id txt
|
||||
3 NULL
|
||||
1 Chevy
|
||||
drop table t1;
|
||||
CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1)));
|
||||
INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,'');
|
||||
CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, d varchar(1) NOT NULL DEFAULT ' ', PRIMARY KEY (i), KEY (c(1),d));
|
||||
INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,'');
|
||||
select max(i) from t1 where c = '';
|
||||
max(i)
|
||||
4
|
||||
|
@ -1693,3 +1693,47 @@ oe
|
||||
ue
|
||||
ss
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
a ENUM('<27>','<27>','<27>') character set utf8 default '<27>'
|
||||
);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` enum('<27>','<27>','<27>') character set utf8 default '<27>'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
insert into t1 values ('<27>'), ('<27>'), ('<27>');
|
||||
select a from t1 order by a;
|
||||
a
|
||||
<EFBFBD>
|
||||
<EFBFBD>
|
||||
<EFBFBD>
|
||||
drop table t1;
|
||||
set names utf8;
|
||||
CREATE TABLE t1 (
|
||||
a ENUM('ä','ö','ü') character set latin1 default 'ü'
|
||||
);
|
||||
insert into t1 values ('ä'),('ö'),('ü');
|
||||
set names latin1;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` enum('<27>','<27>','<27>') default '<27>'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select a from t1 order by a;
|
||||
a
|
||||
<EFBFBD>
|
||||
<EFBFBD>
|
||||
<EFBFBD>
|
||||
drop table t1;
|
||||
create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin);
|
||||
insert into t1 values ('Y');
|
||||
alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
select * from t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t1 t1 a a 254 3 1 Y 384 0 8
|
||||
def test t1 t1 b b 254 9 0 Y 2176 0 8
|
||||
def test t1 t1 c c 254 3 0 Y 384 0 8
|
||||
a b c
|
||||
Y NULL NULL
|
||||
drop table t1;
|
||||
|
@ -22,14 +22,14 @@ select * from t1;
|
||||
f1 f2
|
||||
10 10
|
||||
100000 100000
|
||||
1.23457e+09 1234567890
|
||||
1.23457e+9 1234567890
|
||||
1e+10 10000000000
|
||||
1e+15 1e+15
|
||||
1e+20 1e+20
|
||||
3.40282e+38 1e+50
|
||||
3.40282e+38 1e+150
|
||||
-10 -10
|
||||
1e-05 1e-05
|
||||
1e-5 1e-5
|
||||
1e-10 1e-10
|
||||
1e-15 1e-15
|
||||
1e-20 1e-20
|
||||
@ -137,6 +137,8 @@ t1 CREATE TABLE `t1` (
|
||||
drop table t1;
|
||||
create table t1 (c20 char);
|
||||
insert into t1 values (5000.0);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c20' at row 1
|
||||
drop table t1;
|
||||
create table t1 (f float(54));
|
||||
ERROR 42000: Incorrect column specifier for column 'f'
|
||||
|
57
mysql-test/t/bdb-deadlock.tminus
Normal file
57
mysql-test/t/bdb-deadlock.tminus
Normal file
@ -0,0 +1,57 @@
|
||||
# This test doesn't work with the embedded version as this code
|
||||
# assumes that one query is running while we are doing queries on
|
||||
# a second connection.
|
||||
# This would work if mysqltest run would be threaded and handle each
|
||||
# connection in a separate thread.
|
||||
#
|
||||
|
||||
#-- source include/not_embedded.inc
|
||||
-- source include/have_bdb.inc
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
connection con1;
|
||||
create table t1 (id integer, x integer) engine=BDB;
|
||||
create table t2 (id integer, x integer) engine=BDB;
|
||||
insert into t1 values(0, 0);
|
||||
insert into t2 values(0, 0);
|
||||
set autocommit=0;
|
||||
update t1 set x = 1 where id = 0;
|
||||
|
||||
connection con2;
|
||||
set autocommit=0;
|
||||
update t2 set x = 1 where id = 0;
|
||||
|
||||
# The following query should hang because con1 is locking the page
|
||||
--send
|
||||
select x from t1 where id = 0;
|
||||
|
||||
connection con1;
|
||||
# This should generate a deadlock as we are trying to access a locked row
|
||||
--send
|
||||
select x from t2 where id = 0;
|
||||
|
||||
connection con2;
|
||||
--error 1213
|
||||
reap;
|
||||
commit;
|
||||
|
||||
connection con1;
|
||||
reap;
|
||||
commit;
|
||||
|
||||
connection con2;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
commit;
|
||||
|
||||
connection con1;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
commit;
|
||||
|
||||
drop table t1,t2;
|
@ -4,6 +4,10 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
SET NAMES latin1;
|
||||
SET character_set_connection=ucs2;
|
||||
-- source include/endspace.inc
|
||||
|
||||
SET CHARACTER SET koi8r;
|
||||
|
||||
#
|
||||
|
@ -7,13 +7,7 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
|
||||
select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
|
||||
select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
|
||||
select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
|
||||
select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
|
||||
select 'a a' > 'a', 'a \0' < 'a';
|
||||
select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
|
||||
-- source include/endspace.inc
|
||||
|
||||
#
|
||||
# Test MyISAM tables.
|
||||
|
@ -267,3 +267,16 @@ DROP DATABASE testdb8;
|
||||
DROP DATABASE testdb9;
|
||||
DROP DATABASE testdb10;
|
||||
|
||||
#
|
||||
# Bug #6932: a problem with 'revoke ALL PRIVILEGES'
|
||||
#
|
||||
|
||||
create table t1(a int, b int, c int, d int);
|
||||
grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
|
||||
show grants for grant_user@localhost;
|
||||
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
|
||||
revoke ALL PRIVILEGES on t1 from grant_user@localhost;
|
||||
show grants for grant_user@localhost;
|
||||
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
|
||||
drop user grant_user@localhost;
|
||||
drop table t1;
|
||||
|
@ -185,3 +185,13 @@ DELETE FROM t1 WHERE date<1101106546;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #6878: a problem with small length records
|
||||
#
|
||||
|
||||
create table t1(a char(2)) engine=memory;
|
||||
insert into t1 values (NULL), (NULL);
|
||||
delete from t1 where a is null;
|
||||
insert into t1 values ('2'), ('3');
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
@ -89,6 +89,19 @@ show binlog events;
|
||||
select * from t1;
|
||||
drop table t1, t2;
|
||||
|
||||
# Verify that a partly-completed CREATE TABLE .. SELECT does not
|
||||
# get into the binlog (Bug #6682)
|
||||
create table t1(a int);
|
||||
insert into t1 values(1),(1);
|
||||
reset master;
|
||||
--error 1062
|
||||
create table t2(unique(a)) select a from t1;
|
||||
# The above should produce an error, *and* not appear in the binlog
|
||||
let $VERSION=`select version()`;
|
||||
--replace_result $VERSION VERSION
|
||||
show binlog events;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test of insert ... select from same table
|
||||
#
|
||||
|
@ -157,3 +157,13 @@ select * from t1 where a = 'AaA' order by p;
|
||||
# 6
|
||||
select * from t1 where a = 'AAA' order by p;
|
||||
drop table t1;
|
||||
|
||||
# bug
|
||||
create table t1 (
|
||||
a varchar(10) primary key
|
||||
) engine=ndb;
|
||||
insert into t1 values ('jonas % ');
|
||||
replace into t1 values ('jonas % ');
|
||||
replace into t1 values ('jonas % ');
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
@ -471,4 +471,3 @@ execute stmt using @var, @var, @var;
|
||||
set @var=null;
|
||||
select @var is null, @var is not null, @var;
|
||||
execute stmt using @var, @var, @var;
|
||||
|
||||
|
@ -154,9 +154,9 @@ select hex(c1), hex(c2) from t1;
|
||||
|
||||
stop slave;
|
||||
delete from t1;
|
||||
change master to master_log_pos=5801;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=5937;
|
||||
# Slave is supposed to stop _after_ the INSERT, even though 5937 is
|
||||
change master to master_log_pos=5847;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=5983;
|
||||
# Slave is supposed to stop _after_ the INSERT, even though 5983 is
|
||||
# the position of the beginning of the INSERT; after SET slave is not
|
||||
# supposed to increment position.
|
||||
wait_for_slave_to_stop;
|
||||
|
1
mysql-test/t/rpl_create_database-master.opt
Normal file
1
mysql-test/t/rpl_create_database-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--binlog-do-db=mysqltest_sisyfos --binlog-do-db=mysqltest_prometheus
|
1
mysql-test/t/rpl_create_database-slave.opt
Normal file
1
mysql-test/t/rpl_create_database-slave.opt
Normal file
@ -0,0 +1 @@
|
||||
--replicate-do-db=mysqltest_sisyfos --replicate-do-db=mysqltest_prometheus
|
70
mysql-test/t/rpl_create_database.test
Normal file
70
mysql-test/t/rpl_create_database.test
Normal file
@ -0,0 +1,70 @@
|
||||
#
|
||||
# Tests for replication of statements that manipulate databases.
|
||||
#
|
||||
# For this test file, we have a number of databases. All databases
|
||||
# with "greek" names will be replicated on the slave, while other names
|
||||
# (e.g., american) will not be replicated.
|
||||
#
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
# Bug#6391 (binlog-do-db rules ignored)
|
||||
# In this case, 'mysqltest_bob' should not be replicated to the slave.
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mysqltest_prometheus;
|
||||
DROP DATABASE IF EXISTS mysqltest_sisyfos;
|
||||
DROP DATABASE IF EXISTS mysqltest_bob;
|
||||
sync_slave_with_master;
|
||||
# This database is not replicated
|
||||
DROP DATABASE IF EXISTS mysqltest_bob;
|
||||
--enable_warnings
|
||||
|
||||
connection master;
|
||||
CREATE DATABASE mysqltest_prometheus;
|
||||
CREATE DATABASE mysqltest_sisyfos;
|
||||
CREATE DATABASE mysqltest_bob;
|
||||
|
||||
USE mysqltest_sisyfos;
|
||||
# These should be replicated
|
||||
CREATE TABLE t1 (b int);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
|
||||
USE mysqltest_bob;
|
||||
# These should *not* be replicated
|
||||
CREATE TABLE t2 (b int);
|
||||
INSERT INTO t2 VALUES(2);
|
||||
|
||||
# Current database is now 'mysqltest_bob'
|
||||
# The following should be replicated
|
||||
ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
|
||||
|
||||
USE mysqltest_sisyfos;
|
||||
# The following should *not* be replicated
|
||||
ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
|
||||
|
||||
SHOW DATABASES;
|
||||
sync_slave_with_master;
|
||||
SHOW DATABASES;
|
||||
|
||||
connection master;
|
||||
DROP DATABASE IF EXISTS mysqltest_sisyfos;
|
||||
USE mysqltest_prometheus;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE DATABASE mysqltest_sisyfos;
|
||||
USE mysqltest_sisyfos;
|
||||
CREATE TABLE t2 (a INT);
|
||||
let $VERSION=`select version()`;
|
||||
--replace_result $VERSION VERSION
|
||||
SHOW BINLOG EVENTS;
|
||||
SHOW DATABASES;
|
||||
sync_slave_with_master;
|
||||
SHOW DATABASES;
|
||||
SHOW CREATE TABLE mysqltest_prometheus.t1;
|
||||
SHOW CREATE TABLE mysqltest_sisyfos.t2;
|
||||
|
||||
connection master;
|
||||
DROP DATABASE IF EXISTS mysqltest_prometheus;
|
||||
DROP DATABASE IF EXISTS mysqltest_sisyfos;
|
||||
DROP DATABASE IF EXISTS mysqltest_bob;
|
||||
sync_slave_with_master;
|
@ -43,7 +43,7 @@ show slave status;
|
||||
|
||||
# try replicate all until second insert to t2;
|
||||
start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537;
|
||||
sleep 2;
|
||||
sleep 4;
|
||||
select * from t2;
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 1 # 9 # 23 # 33 #
|
||||
|
@ -72,3 +72,44 @@ CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate latin1_german2_ci);
|
||||
INSERT INTO t1 VALUES ('<27>'),('<27>'),('<27>'),('<27>');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #6379: ENUM values are incorrectly converted
|
||||
#
|
||||
# Check latin1 -> utf8 conversion
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
a ENUM('<27>','<27>','<27>') character set utf8 default '<27>'
|
||||
);
|
||||
show create table t1;
|
||||
insert into t1 values ('<27>'), ('<27>'), ('<27>');
|
||||
select a from t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Now check utf8 -> latin1 conversion
|
||||
# This test emulates loading a script generated with mysqldump
|
||||
#
|
||||
set names utf8;
|
||||
CREATE TABLE t1 (
|
||||
a ENUM('ä','ö','ü') character set latin1 default 'ü'
|
||||
);
|
||||
insert into t1 values ('ä'),('ö'),('ü');
|
||||
# Now check what has been loaded
|
||||
set names latin1;
|
||||
show create table t1;
|
||||
select a from t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test bug where enum fields where extended for each ALTER TABLE
|
||||
#
|
||||
|
||||
create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin);
|
||||
insert into t1 values ('Y');
|
||||
alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
--enable_metadata
|
||||
select * from t1;
|
||||
--disable metadata
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user