mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/home/jonas/src/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1-ndb BitKeeper/etc/logging_ok: auto-union ndb/include/ndb_global.h: Auto merged ndb/src/common/mgmcommon/NdbConfig.c: Auto merged
This commit is contained in:
@ -111,10 +111,10 @@ a b
|
||||
aaa bbb
|
||||
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
|
||||
charset(a) charset(b) charset(binary 'ccc')
|
||||
latin1 binary latin1
|
||||
latin1 binary binary
|
||||
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
|
||||
collation(a) collation(b) collation(binary 'ccc')
|
||||
latin1_bin binary latin1_bin
|
||||
latin1_bin binary binary
|
||||
drop table t1;
|
||||
create table t1( firstname char(20), lastname char(20));
|
||||
insert into t1 values ("john","doe"),("John","Doe");
|
||||
|
@ -40,6 +40,7 @@ show tables;
|
||||
Tables_in_test
|
||||
update mysql.user set password=old_password("gambling2") where user=_binary"test";
|
||||
flush privileges;
|
||||
set password="";
|
||||
set password='gambling3';
|
||||
ERROR HY000: Password hash should be a 41-digit hexadecimal number
|
||||
set password=old_password('gambling3');
|
||||
|
@ -1,19 +1,19 @@
|
||||
drop table if exists t1, t2;
|
||||
CREATE TABLE t1 ( a int );
|
||||
INSERT INTO t1 VALUES (1),(2),(1);
|
||||
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
|
||||
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
select * from t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
|
||||
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
select * from t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
|
||||
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
select * from t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
|
||||
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
select * from t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
|
@ -49,8 +49,8 @@ a b
|
||||
aaa bbb
|
||||
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
|
||||
charset(a) charset(b) charset(binary 'ccc')
|
||||
cp1251 binary cp1251
|
||||
cp1251 binary binary
|
||||
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
|
||||
collation(a) collation(b) collation(binary 'ccc')
|
||||
cp1251_bin binary cp1251_bin
|
||||
cp1251_bin binary binary
|
||||
drop table t1;
|
||||
|
@ -1,5 +1,4 @@
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
drop table if exists t1,t2;
|
||||
set names utf8;
|
||||
select left(_utf8 0xD0B0D0B1D0B2,1);
|
||||
left(_utf8 0xD0B0D0B1D0B2,1)
|
||||
|
@ -19,7 +19,7 @@ select '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 0 0
|
||||
1 1 1
|
||||
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
|
||||
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
|
||||
check table t1;
|
||||
@ -52,13 +52,13 @@ select * from t1 ignore key (key1) where text1='teststring' or text1 like 'tests
|
||||
text1
|
||||
teststring
|
||||
teststring
|
||||
select * from t1 where text1='teststring' or text1 like 'teststring_%';
|
||||
text1
|
||||
teststring
|
||||
teststring
|
||||
select * from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
text1
|
||||
teststring
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
|
||||
concat('|', text1, '|')
|
||||
|teststring |
|
||||
|teststring|
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
concat('|', text1, '|')
|
||||
|teststring|
|
||||
select text1, length(text1) from t1 order by text1;
|
||||
text1 length(text1)
|
||||
nothing 7
|
||||
@ -77,7 +77,28 @@ concat('|', text1, '|')
|
||||
|teststring|
|
||||
|teststring |
|
||||
|teststring |
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
concat('|', text1, '|')
|
||||
|teststring|
|
||||
|teststring |
|
||||
select concat('|', text1, '|') from t1 where text1='teststring';
|
||||
concat('|', text1, '|')
|
||||
|teststring|
|
||||
select concat('|', text1, '|') from t1 where text1='teststring ';
|
||||
concat('|', text1, '|')
|
||||
|teststring |
|
||||
alter table t1 modify text1 text not null, pack_keys=1;
|
||||
select concat('|', text1, '|') from t1 where text1='teststring';
|
||||
concat('|', text1, '|')
|
||||
|teststring|
|
||||
|teststring |
|
||||
select concat('|', text1, '|') from t1 where text1='teststring ';
|
||||
concat('|', text1, '|')
|
||||
|teststring|
|
||||
|teststring |
|
||||
explain select concat('|', text1, '|') from t1 where text1='teststring ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range key1 key1 22 NULL 2 Using where
|
||||
select * from t1 where text1 like 'teststring_%';
|
||||
text1
|
||||
teststring
|
||||
@ -87,10 +108,10 @@ text1
|
||||
teststring
|
||||
teststring
|
||||
teststring
|
||||
select * from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
text1
|
||||
teststring
|
||||
teststring
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
concat('|', text1, '|')
|
||||
|teststring|
|
||||
|teststring |
|
||||
select concat('|', text1, '|') from t1 order by text1;
|
||||
concat('|', text1, '|')
|
||||
|nothing|
|
||||
|
@ -43,7 +43,7 @@ explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY'))
|
||||
Note 1003 select if((test.t1.u = 1),test.t1.st,cast(test.t1.st as char charset binary)) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,cast(test.t1.st as char charset binary))
|
||||
select nullif(u=0, 'test') from t1;
|
||||
nullif(u=0, 'test')
|
||||
NULL
|
||||
|
@ -638,7 +638,7 @@ explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'moo
|
||||
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 md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,(_latin1'HE' collate _latin1'BINARY') AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")`
|
||||
Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,cast(_latin1'HE' as char charset binary) AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")`
|
||||
SELECT lpad(12345, 5, "#");
|
||||
lpad(12345, 5, "#")
|
||||
12345
|
||||
|
@ -466,3 +466,22 @@ insert IGNORE into t1 values ('Garbage');
|
||||
ERROR HY000: Unknown error
|
||||
alter table t1 add spatial index(a);
|
||||
drop table t1;
|
||||
create table t1(a geometry not null, spatial index(a));
|
||||
insert into t1 values
|
||||
(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')),
|
||||
(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)'));
|
||||
select AsText(a) from t1 where
|
||||
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
|
||||
or
|
||||
MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a);
|
||||
AsText(a)
|
||||
POINT(1 1)
|
||||
POINT(3 3)
|
||||
POINT(4 4)
|
||||
select AsText(a) from t1 where
|
||||
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
|
||||
and
|
||||
MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a);
|
||||
AsText(a)
|
||||
POINT(1 1)
|
||||
drop table t1;
|
||||
|
@ -127,3 +127,4 @@ having (a.description is not null) and (c=0);
|
||||
id description c
|
||||
1 test 0
|
||||
2 test2 0
|
||||
drop table t1,t2,t3;
|
||||
|
@ -58,3 +58,10 @@ ERROR 42000: Not unique table/alias: 'C'
|
||||
drop table t1, t2;
|
||||
show tables;
|
||||
Tables_in_test
|
||||
create table t1 (a int);
|
||||
select TEST.t1.* from TEST.t1;
|
||||
a
|
||||
alter table t1 rename to T1;
|
||||
select TEST.t1.* from TEST.t1;
|
||||
a
|
||||
drop table t1;
|
||||
|
@ -412,7 +412,6 @@ aaa.
|
||||
aaa .
|
||||
select concat(a,'.') from t1 where binary a='aaa';
|
||||
concat(a,'.')
|
||||
aaa .
|
||||
aaa.
|
||||
update t1 set a='bbb' where a='aaa';
|
||||
select concat(a,'.') from t1;
|
||||
|
@ -205,4 +205,10 @@ a b c
|
||||
select * from t1 where b<=5 and c=0 or b<=5 and c=2;
|
||||
a b c
|
||||
19 4 0
|
||||
select count(*) from t1 where b = 0;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t1 where b = 1;
|
||||
count(*)
|
||||
1
|
||||
drop table t1;
|
||||
|
@ -593,9 +593,12 @@ create table t1 (id integer primary key auto_increment, txt text, unique index t
|
||||
insert into t1 (txt) values ('Chevy'), ('Chevy '), (NULL);
|
||||
select * from t1 where txt='Chevy' or txt is NULL;
|
||||
id txt
|
||||
3 NULL
|
||||
1 Chevy
|
||||
2 Chevy
|
||||
3 NULL
|
||||
explain select * from t1 where txt='Chevy' or txt is NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range txt_index txt_index 23 NULL 2 Using where
|
||||
select * from t1 where txt='Chevy ';
|
||||
id txt
|
||||
1 Chevy
|
||||
@ -663,6 +666,21 @@ id txt
|
||||
1 Chevy
|
||||
2 Chevy
|
||||
4 Ford
|
||||
alter table t1 modify column txt blob;
|
||||
explain select * from t1 where txt='Chevy' or txt is NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where
|
||||
select * from t1 where txt='Chevy' or txt is NULL;
|
||||
id txt
|
||||
1 Chevy
|
||||
3 NULL
|
||||
explain select * from t1 where txt='Chevy' or txt is NULL order by txt;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where; Using filesort
|
||||
select * from t1 where txt='Chevy' or txt is NULL order by txt;
|
||||
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,'');
|
||||
|
@ -272,7 +272,7 @@ auto bigint(17) unsigned NULL PRI 0 select,insert,update,references
|
||||
t1 bigint(1) NULL 0 select,insert,update,references
|
||||
t2 char(1) latin1_swedish_ci select,insert,update,references
|
||||
t3 longtext latin1_swedish_ci select,insert,update,references
|
||||
t4 longtext latin1_bin select,insert,update,references
|
||||
t4 longblob NULL select,insert,update,references
|
||||
select * from t2;
|
||||
auto t1 t2 t3 t4
|
||||
11 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
|
@ -365,3 +365,15 @@ select * from t1;
|
||||
t1 i
|
||||
2004-04-01 00:00:00 10
|
||||
drop table t1;
|
||||
create table t1 (ts timestamp(19));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
set TIMESTAMP=1000000000;
|
||||
insert into t1 values ();
|
||||
select * from t1;
|
||||
ts
|
||||
2001-09-09 04:46:40
|
||||
drop table t1;
|
||||
|
@ -48,6 +48,7 @@ flush privileges;
|
||||
#connect (con1,localhost,test,gambling2,"");
|
||||
#show tables;
|
||||
connect (con1,localhost,test,gambling2,mysql);
|
||||
set password="";
|
||||
--error 1105
|
||||
set password='gambling3';
|
||||
set password=old_password('gambling3');
|
||||
|
@ -12,18 +12,18 @@ drop table if exists t1, t2;
|
||||
CREATE TABLE t1 ( a int );
|
||||
INSERT INTO t1 VALUES (1),(2),(1);
|
||||
--error 1062;
|
||||
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
|
||||
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
|
||||
--error 1146;
|
||||
select * from t2;
|
||||
--error 1062;
|
||||
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
|
||||
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
|
||||
--error 1146;
|
||||
select * from t2;
|
||||
--error 1062;
|
||||
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
|
||||
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
|
||||
--error 1146;
|
||||
select * from t2;
|
||||
--error 1062;
|
||||
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
|
||||
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
|
||||
--error 1146;
|
||||
select * from t2;
|
||||
|
@ -3,8 +3,7 @@
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
set names utf8;
|
||||
|
||||
|
@ -31,19 +31,25 @@ explain select * from t1 order by text1;
|
||||
alter table t1 modify text1 char(32) binary not null;
|
||||
check table t1;
|
||||
select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
|
||||
select * from t1 where text1='teststring' or text1 like 'teststring_%';
|
||||
select * from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
select text1, length(text1) from t1 order by text1;
|
||||
select text1, length(text1) from t1 order by binary text1;
|
||||
|
||||
alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
|
||||
insert into t1 values ('teststring ');
|
||||
select concat('|', text1, '|') from t1 order by text1;
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
select concat('|', text1, '|') from t1 where text1='teststring';
|
||||
select concat('|', text1, '|') from t1 where text1='teststring ';
|
||||
|
||||
alter table t1 modify text1 text not null, pack_keys=1;
|
||||
select concat('|', text1, '|') from t1 where text1='teststring';
|
||||
select concat('|', text1, '|') from t1 where text1='teststring ';
|
||||
explain select concat('|', text1, '|') from t1 where text1='teststring ';
|
||||
select * from t1 where text1 like 'teststring_%';
|
||||
select * from t1 where text1='teststring' or text1 like 'teststring_%';
|
||||
select * from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
select concat('|', text1, '|') from t1 order by text1;
|
||||
drop table t1;
|
||||
|
||||
|
@ -172,3 +172,21 @@ insert IGNORE into t1 values ('Garbage');
|
||||
alter table t1 add spatial index(a);
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #5219: problem with range optimizer
|
||||
#
|
||||
|
||||
create table t1(a geometry not null, spatial index(a));
|
||||
insert into t1 values
|
||||
(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')),
|
||||
(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)'));
|
||||
select AsText(a) from t1 where
|
||||
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
|
||||
or
|
||||
MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a);
|
||||
select AsText(a) from t1 where
|
||||
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
|
||||
and
|
||||
MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a);
|
||||
drop table t1;
|
||||
|
@ -121,3 +121,4 @@ select
|
||||
from t1 a left join t3 b on a.id=b.order_id
|
||||
group by a.id, a.description
|
||||
having (a.description is not null) and (c=0);
|
||||
drop table t1,t2,t3;
|
||||
|
@ -54,3 +54,13 @@ select C.a, c.a from t1 c, t2 C;
|
||||
drop table t1, t2;
|
||||
|
||||
show tables;
|
||||
|
||||
#
|
||||
# Test all caps database name
|
||||
#
|
||||
create table t1 (a int);
|
||||
select TEST.t1.* from TEST.t1;
|
||||
alter table t1 rename to T1;
|
||||
select TEST.t1.* from TEST.t1;
|
||||
drop table t1;
|
||||
|
||||
|
@ -113,6 +113,9 @@ select * from t1 where b<=5 and c=0;
|
||||
select * from t1 where b=4 and c<=5 order by a;
|
||||
select * from t1 where b<=4 and c<=5 order by a;
|
||||
select * from t1 where b<=5 and c=0 or b<=5 and c=2;
|
||||
|
||||
select count(*) from t1 where b = 0;
|
||||
select count(*) from t1 where b = 1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
|
@ -340,6 +340,7 @@ drop table t1;
|
||||
create table t1 (id integer primary key auto_increment, txt text, unique index txt_index (txt (20)));
|
||||
insert into t1 (txt) values ('Chevy'), ('Chevy '), (NULL);
|
||||
select * from t1 where txt='Chevy' or txt is NULL;
|
||||
explain select * from t1 where txt='Chevy' or txt is NULL;
|
||||
select * from t1 where txt='Chevy ';
|
||||
select * from t1 where txt='Chevy ' or txt='Chevy';
|
||||
select * from t1 where txt='Chevy' or txt='Chevy ';
|
||||
@ -358,7 +359,13 @@ select * from t1 where txt < 'Chevy ' or txt is NULL;
|
||||
select * from t1 where txt <= 'Chevy';
|
||||
select * from t1 where txt > 'Chevy';
|
||||
select * from t1 where txt >= 'Chevy';
|
||||
alter table t1 modify column txt blob;
|
||||
explain select * from t1 where txt='Chevy' or txt is NULL;
|
||||
select * from t1 where txt='Chevy' or txt is NULL;
|
||||
explain select * from t1 where txt='Chevy' or txt is NULL order by txt;
|
||||
select * from t1 where txt='Chevy' or txt is NULL order by txt;
|
||||
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,'');
|
||||
select max(i) from t1 where c = '';
|
||||
|
@ -234,3 +234,13 @@ alter table t1 add i int default 10;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
# Test for bug #4491, TIMESTAMP(19) should be possible to create and not
|
||||
# only read in 4.0
|
||||
#
|
||||
create table t1 (ts timestamp(19));
|
||||
show create table t1;
|
||||
set TIMESTAMP=1000000000;
|
||||
insert into t1 values ();
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user