Commit 27762df3 authored by Sergei Golubchik's avatar Sergei Golubchik

fixing pbxt and oqgraph suites

parent 4b70fc0c
......@@ -54,6 +54,7 @@ while ($wait_counter)
if (!$success)
{
echo Timeout in wait_condition.inc for $wait_condition;
show full processlist;
}
--enable_query_log
......@@ -162,7 +162,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
# If you add a new suite, please check TEST_DIRS in Makefile.am.
#
my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,innodb,perfschema,maria,parts,percona,vcol,oqgraph,sphinx";
my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,innodb,perfschema,maria,parts,percona,vcol,oqgraph,sphinx,pbxt";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
......
This diff is collapsed.
......@@ -55,6 +55,6 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 a 1 a A 5 NULL NULL YES BTREE
drop table t1;
......@@ -5,7 +5,7 @@ count(distinct n)
100
explain extended select count(distinct n) from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL n 4 NULL 200 100.00 Using index
1 SIMPLE t1 range NULL n 4 NULL 201 99.50 Using index for group-by (scanning)
Warnings:
Note 1003 select count(distinct `test`.`t1`.`n`) AS `count(distinct n)` from `test`.`t1`
drop table t1;
......@@ -101,16 +101,16 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
`c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
`c3` varbinary(1) NOT NULL DEFAULT '',
`c4` varbinary(1) NOT NULL DEFAULT '',
`c5` varbinary(4) NOT NULL DEFAULT '',
`c6` varbinary(4) NOT NULL DEFAULT '',
`c3` varchar(1) NOT NULL DEFAULT '',
`c4` varchar(1) NOT NULL DEFAULT '',
`c5` varchar(4) NOT NULL DEFAULT '',
`c6` varchar(4) NOT NULL DEFAULT '',
`c7` decimal(2,1) NOT NULL DEFAULT '0.0',
`c8` decimal(2,1) NOT NULL DEFAULT '0.0',
`c9` decimal(2,1) DEFAULT NULL,
`c10` double NOT NULL DEFAULT '0',
`c11` double NOT NULL DEFAULT '0',
`c12` varbinary(5) NOT NULL DEFAULT ''
`c12` varchar(5) NOT NULL DEFAULT ''
) ENGINE=PBXT DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT CASE
......@@ -155,8 +155,8 @@ t1 CREATE TABLE `t1` (
`COALESCE(1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
`COALESCE('a')` varchar(1) NOT NULL DEFAULT '',
`COALESCE(1,1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
`COALESCE(1,'1')` varbinary(1) NOT NULL DEFAULT '',
`COALESCE(1.1,'1')` varbinary(4) NOT NULL DEFAULT '',
`COALESCE(1,'1')` varchar(1) NOT NULL DEFAULT '',
`COALESCE(1.1,'1')` varchar(4) NOT NULL DEFAULT '',
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
) ENGINE=PBXT DEFAULT CHARSET=latin1
DROP TABLE t1;
......
......@@ -342,18 +342,18 @@ INSERT INTO t1 SET f1 = -1.0e+30 ;
INSERT INTO t1 SET f1 = +1.0e+30 ;
SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
double_val cast_val
-1e+30 -9223372036854775808
1e+30 9223372036854775807
-1e30 -9223372036854775808
1e30 9223372036854775807
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '-1e+30'
Warning 1292 Truncated incorrect INTEGER value: '1e+30'
Warning 1292 Truncated incorrect INTEGER value: '-1e30'
Warning 1292 Truncated incorrect INTEGER value: '1e30'
DROP TABLE t1;
select cast('1.2' as decimal(3,2));
cast('1.2' as decimal(3,2))
1.20
select 1e18 * cast('1.2' as decimal(3,2));
1e18 * cast('1.2' as decimal(3,2))
1.2e+18
1.2e18
select cast(cast('1.2' as decimal(3,2)) as signed);
cast(cast('1.2' as decimal(3,2)) as signed)
1
......@@ -370,7 +370,7 @@ select cast(s1 as decimal(7,2)) from t1;
cast(s1 as decimal(7,2))
99999.99
Warnings:
Error 1264 Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
Warning 1264 Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
drop table t1;
CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
mt mediumtext, lt longtext);
......
......@@ -18,9 +18,9 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" />
<field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
<field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
<field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
......
......@@ -47,9 +47,9 @@ insert into t1 values (0x01,0x01);
select * from t1 where a=b;
a b
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '\x01'
select * from t1 where a=b and b=0x01;
a b
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: '\x01'
drop table if exists t1;
......@@ -15,6 +15,7 @@ ndb_binlog_index
plugin
proc
procs_priv
proxies_priv
servers
slow_log
tables_priv
......@@ -48,6 +49,7 @@ ndb_binlog_index
plugin
proc
procs_priv
proxies_priv
servers
slow_log
tables_priv
......@@ -89,6 +91,7 @@ ndb_binlog_index
plugin
proc
procs_priv
proxies_priv
servers
slow_log
tables_priv
......
......@@ -3,7 +3,7 @@ create table t1 (a int check (a>0));
insert into t1 values (1);
insert into t1 values (0);
drop table t1;
create table t1 (a int ,b int, check a>b);
create table t1 (a int, b int, check (a>b));
insert into t1 values (1,0);
insert into t1 values (0,1);
drop table t1;
......
This diff is collapsed.
This diff is collapsed.
......@@ -281,7 +281,7 @@ select * from t1;
N M
3 0
delete P1.*,p2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS p2 ON P1.N = p2.N;
ERROR 42S02: Unknown table 'p2' in MULTI DELETE
ERROR HY000: The target table p2 of the DELETE is not updatable
delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
ERROR 42S22: Unknown column 'aaa' in 'field list'
drop table t1;
......@@ -330,10 +330,8 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index
drop table t2;
CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) NOT NULL default '', `vendor` int(11) NOT NULL default '0', `date_` date NOT NULL default '0000-00-00', `price` decimal(12,2) NOT NULL default '0.00', PRIMARY KEY (`itemid`,`grpid`,`vendor`,`date_`), KEY `itemid` (`itemid`,`vendor`), KEY `itemid_2` (`itemid`,`date_`));
insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10);
Warnings:
Note 1265 Data truncated for column 'date_' at row 1
Note 1265 Data truncated for column 'date_' at row 2
insert into t1 values (128, 'rozn', 2, curdate(), 10),
(128, 'rozn', 1, curdate(), 10);
SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices;
min max avg
10.00 10.00 10
......
......@@ -51,6 +51,7 @@ mtr
mysql
mysqltest
pbxt
performance_schema
test
flush tables with read lock;
drop database mysqltest;
......@@ -63,6 +64,7 @@ information_schema
mtr
mysql
pbxt
performance_schema
test
drop database mysqltest;
ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist
......@@ -79,8 +81,8 @@ drop table t1;
drop database if exists mysqltest;
drop table if exists t1;
create table t1 (i int);
lock tables t1 read;
create database mysqltest;
lock tables t1 read;
drop table t1;
show open tables;
drop database mysqltest;
......
......@@ -33,6 +33,9 @@ flush tables with read lock;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
lock table t1 read;
flush tables with read lock;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
flush tables with read lock;
lock table t1 write;
ERROR HY000: Can't execute the query because you have a conflicting read lock
lock table t1 read;
......@@ -46,6 +49,7 @@ flush tables with read lock;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
lock table t1 read, t2 read, t3 read;
flush tables with read lock;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
drop table t1, t2, t3;
create table t1 (c1 int);
......
......@@ -3,21 +3,14 @@ create table t1 (a int not null auto_increment primary key);
insert into t1 values(0);
lock table t1 read;
flush table t1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
unlock tables;
lock table t1 write;
flush table t1;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
unlock tables;
lock table t1 read;
lock table t1 read;
flush table t1;
select * from t1;
a
1
unlock tables;
select * from t1;
a
1
unlock tables;
lock table t1 write;
lock table t1 read;
flush table t1;
......@@ -26,7 +19,7 @@ a
1
unlock tables;
unlock tables;
lock table t1 read;
lock table t1 write;
lock table t1 write;
flush table t1;
select * from t1;
......
......@@ -153,10 +153,10 @@ grp group_concat(c)
4
5 NULL
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
show warnings;
Level Code Message
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
set group_concat_max_len = 1024;
select group_concat(sum(c)) from t1 group by grp;
ERROR HY000: Invalid use of group function
......@@ -380,25 +380,29 @@ group_concat(b)
bb,c
BB,C
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(distinct b) from t1 group by a;
group_concat(distinct b)
bb,c
BB,C
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(b order by b) from t1 group by a;
group_concat(b order by b)
a,bb
A,BB
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
Warning 1260 Row 6 was cut by GROUP_CONCAT()
select group_concat(distinct b order by b) from t1 group by a;
group_concat(distinct b order by b)
a,bb
A,BB
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
Warning 1260 Row 6 was cut by GROUP_CONCAT()
insert into t1 values (1, concat(repeat('1', 300), '2')),
(1, concat(repeat('1', 300), '2')), (1, concat(repeat('0', 300), '1')),
(2, concat(repeat('1', 300), '2')), (2, concat(repeat('1', 300), '2')),
......@@ -426,25 +430,29 @@ group_concat(b)
bb,ccc,a,bb,ccc,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111
BB,CCC,A,BB,CCC,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 7 was cut by GROUP_CONCAT()
Warning 1260 Row 14 was cut by GROUP_CONCAT()
select group_concat(distinct b) from t1 group by a;
group_concat(distinct b)
bb,ccc,a,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
BB,CCC,A,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 5 was cut by GROUP_CONCAT()
Warning 1260 Row 10 was cut by GROUP_CONCAT()
select group_concat(b order by b) from t1 group by a;
group_concat(b order by b)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(distinct b order by b) from t1 group by a;
group_concat(distinct b order by b)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
drop table t1;
create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci,
b varchar(255) character set koi8r);
......@@ -617,7 +625,7 @@ insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
select f2,group_concat(f1) from t1 group by f2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 f2 f2 253 255 255 Y 0 0 8
def group_concat(f1) 253 400 1 Y 128 0 63
def group_concat(f1) 253 400 1 Y 0 0 8
f2 group_concat(f1)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
......@@ -729,7 +737,7 @@ insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
select f2,group_concat(f1) from t1 group by f2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 f2 f2 253 255 255 Y 0 0 8
def group_concat(f1) 252 1024 1 Y 128 0 63
def group_concat(f1) 252 1024 1 Y 0 0 8
f2 group_concat(f1)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
......
......@@ -61,7 +61,7 @@ grp sum
NULL NULL
1 7
2 20.25
3 45.4831632475944
3 45.48316324759439
create table t2 (grp int, a bigint unsigned, c char(10));
insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp;
replace into t2 select grp, a, c from t1 limit 2,1;
......@@ -891,7 +891,7 @@ select 1e8 * sum(distinct df) from t1;
330000000
select 1e8 * min(df) from t1;
1e8 * min(df)
110000000
110000000.00000001
create table t3 (ifl int);
insert into t3 values(1), (2);
select cast(min(ifl) as decimal(5,2)) from t3;
......@@ -1186,7 +1186,7 @@ std(s1/s2)
0.21325764
select std(o1/o2) from bug22555;
std(o1/o2)
0.213257635866493
0.2132576358664934
select std(e1/e2) from bug22555;
std(e1/e2)
0.21325764
......@@ -1209,13 +1209,13 @@ i count(*) std(e1/e2)
3 4 0.000000000000000000000000000000
select round(std(s1/s2), 17) from bug22555;
round(std(s1/s2), 17)
0.21325763586649341
0.21325763586649340
select std(o1/o2) from bug22555;
std(o1/o2)
0.213257635866493
0.2132576358664934
select round(std(e1/e2), 17) from bug22555;
round(std(e1/e2), 17)
0.21325763586649341
0.21325763586649340
set div_precision_increment=20;
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
i count(*) std(s1/s2)
......@@ -1234,13 +1234,13 @@ i count(*) std(e1/e2)
3 4 0.000000000000000000000000000000
select round(std(s1/s2), 17) from bug22555;
round(std(s1/s2), 17)
0.21325763586649341
0.21325763586649340
select std(o1/o2) from bug22555;
std(o1/o2)
0.213257635866493
0.2132576358664934
select round(std(e1/e2), 17) from bug22555;
round(std(e1/e2), 17)
0.21325763586649341
0.21325763586649340
set @@div_precision_increment=@saved_div_precision_increment;
drop table bug22555;
create table bug22555 (s smallint, o double, e decimal);
......
......@@ -10,7 +10,7 @@ explain extended select * from t1 where a like concat('abc','%');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index a a 13 NULL 5 20.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like concat('abc','%'))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like <cache>(concat('abc','%')))
select * from t1 where a like "abc%";
a
abc
......
......@@ -44,7 +44,7 @@ Warnings:
Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)`
select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2)
10 10 NULL NULL NULL 2 NULL NULL
10 10.000000000000002 NULL NULL NULL 2 NULL NULL
explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
......@@ -52,7 +52,7 @@ Warnings:
Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)`
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL)
10 10 NULL NULL NULL
10 10.000000000000002 NULL NULL NULL
explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
......@@ -60,7 +60,7 @@ Warnings:
Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
log2(8) log2(15) log2(-2) log2(0) log2(NULL)
3 3.90689059560852 NULL NULL NULL
3 3.9068905956085187 NULL NULL NULL
explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
......@@ -68,7 +68,7 @@ Warnings:
Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
log10(100) log10(18) log10(-4) log10(0) log10(NULL)
2 1.25527250510331 NULL NULL NULL
2 1.255272505103306 NULL NULL NULL
explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
......@@ -85,7 +85,7 @@ Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4
set @@rand_seed1=10000000,@@rand_seed2=1000000;
select rand(999999),rand();
rand(999999) rand()
0.0142313651873091 0.028870999839968
0.014231365187309091 0.028870999839968048
explain extended select rand(999999),rand();
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
......@@ -98,10 +98,10 @@ explain extended select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format(cot(1),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
select degrees(pi()),radians(360);
degrees(pi()) radians(360)
180 6.28318530717959
180 6.283185307179586
select format(atan(-2, 2), 6);
format(atan(-2, 2), 6)
-0.785398
......@@ -119,7 +119,7 @@ ACOS(1.0)
0
SELECT ASIN(1.0);
ASIN(1.0)
1.5707963267949
1.5707963267948966
SELECT ACOS(0.2*5.0);
ACOS(0.2*5.0)
0
......@@ -128,10 +128,10 @@ ACOS(0.5*2.0)
0
SELECT ASIN(0.8+0.2);
ASIN(0.8+0.2)
1.5707963267949
1.5707963267948966
SELECT ASIN(1.2-0.2);
ASIN(1.2-0.2)
1.5707963267949
1.5707963267948966
select format(4.55, 1), format(4.551, 1);
format(4.55, 1) format(4.551, 1)
4.6 4.6
......@@ -228,27 +228,27 @@ select ln(-1);
ln(-1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select log10(-1);
log10(-1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select log2(-1);
log2(-1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select log(2,-1);
log(2,-1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select log(-2,1);
log(-2,1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
set sql_mode='';
select round(111,-10);
round(111,-10)
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,9 +6,11 @@ flush status;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
create database if not exists mysqltest;
create table mysqltest.t1 (a int,b int,c int);
create table mysqltest.t2 (a int,b int,c int);
......
......@@ -115,6 +115,8 @@ select @@optimizer_prune_level;
@@optimizer_prune_level
1
set optimizer_search_depth=63;
Warnings:
Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead
select @@optimizer_search_depth;
@@optimizer_search_depth
63
......
......@@ -107,8 +107,9 @@ SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname;
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
drop table t1,t2;
drop table t2;
unlock tables;
drop table t1;
CREATE TABLE t1 (
bug_id mediumint(9) NOT NULL auto_increment,
groupset bigint(20) DEFAULT '0' NOT NULL,
......@@ -933,12 +934,261 @@ b sum(1)
18 6
19 6
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, KEY(a));
INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4);
EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2;
CREATE TABLE t1 (a INT, b INT,
PRIMARY KEY (a),
KEY i2(a,b));
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
INSERT INTO t1 SELECT a + 8,b FROM t1;
INSERT INTO t1 SELECT a + 16,b FROM t1;
INSERT INTO t1 SELECT a + 32,b FROM t1;
INSERT INTO t1 SELECT a + 64,b FROM t1;
INSERT INTO t1 SELECT a + 128,b FROM t1 limit 16;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
EXPLAIN SELECT a FROM t1 WHERE a < 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 5 NULL 2
EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2;
1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
DROP TABLE t1;
1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index for group-by
EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 144 Using index
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 144 Using index
SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY)
IGNORE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 144 Using index
EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY) IGNORE INDEX FOR ORDER BY (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 FORCE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 USE INDEX ();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1 USE INDEX () USE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1
FORCE INDEX (PRIMARY)
IGNORE INDEX FOR GROUP BY (i2)
IGNORE INDEX FOR ORDER BY (i2)
USE INDEX (i2);
ERROR HY000: Incorrect usage of USE INDEX and FORCE INDEX
EXPLAIN SELECT a FROM t1 USE INDEX (i2) USE INDEX ();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 FORCE INDEX ();
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
EXPLAIN SELECT a FROM t1 IGNORE INDEX ();
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
EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2)
USE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 # NULL i2 # NULL # #
EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2)
FORCE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL i2 4 NULL 145 Using index for group-by
EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1 IGNORE INDEX (i2) USE INDEX ();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1
USE INDEX FOR GROUP BY (i2)
USE INDEX FOR ORDER BY (i2)
USE INDEX FOR JOIN (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1
USE INDEX FOR JOIN (i2)
USE INDEX FOR JOIN (i2)
USE INDEX FOR JOIN (i2,i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT 1 FROM t1 WHERE a IN
(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index PRIMARY,i2 PRIMARY 4 NULL 144 Using index
1 PRIMARY t1 ALL NULL NULL NULL NULL 144 Using where; FirstMatch(t1)
CREATE TABLE t2 (a INT, b INT, KEY(a));
INSERT INTO t2 VALUES (1, 1), (2, 2), (3,3), (4,4);
EXPLAIN SELECT a, SUM(b) FROM t2 GROUP BY a LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 5 NULL 2
EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
EXPLAIN SELECT 1 FROM t2 WHERE a IN
(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index a a 5 NULL 4 Using index
1 PRIMARY t1 ALL NULL NULL NULL NULL 144 Using where; FirstMatch(t2)
SHOW VARIABLES LIKE 'old';
Variable_name Value
old OFF
SET @@old = off;
ERROR HY000: Variable 'old' is a read only variable
DROP TABLE t1, t2;
......@@ -1800,10 +1800,10 @@ b
a
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 32 100.00 Using where; Using index
......
......@@ -3,7 +3,7 @@ create table t1 (a int not null,b int not null, primary key (a)) engine=heap com
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 a NULL 3 NULL NULL HASH
select * from t1;
a b
......
......@@ -3,7 +3,7 @@ create table t1 (a int not null,b int not null, primary key using BTREE (a)) eng
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 a A NULL NULL NULL BTREE
select * from t1;
a b
......
......@@ -3,7 +3,7 @@ create table t1 (a int not null,b int not null, primary key using HASH (a)) engi
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 a NULL 3 NULL NULL HASH
select * from t1;
a b
......@@ -327,12 +327,12 @@ explain select * from t1 ignore index (btree_idx) where name='matt';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref heap_idx heap_idx 22 const 7 Using where
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 id NULL 91 NULL NULL HASH
t1 1 heap_idx 1 name NULL 13 NULL NULL HASH
t1 1 btree_idx 1 name A NULL NULL NULL BTREE
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 id NULL 91 NULL NULL HASH
t1 1 heap_idx 1 name NULL 13 NULL NULL HASH
t1 1 btree_idx 1 name A NULL NULL NULL BTREE
......@@ -344,11 +344,11 @@ key (a,b)
) engine=heap;
insert into t3 select name, name from t1;
show index from t3;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t3 1 a 1 a NULL NULL NULL NULL HASH
t3 1 a 2 b NULL 13 NULL NULL HASH
show index from t3;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t3 1 a 1 a NULL NULL NULL NULL HASH
t3 1 a 2 b NULL 13 NULL NULL HASH
explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name;
......
......@@ -175,12 +175,12 @@ Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 4
original_value 1e+1111111111a
f_double 1.79769313486232e+308
f_float 3.40282e+38
f_double 1.7976931348623157e308
f_float 3.40282e38
f_double_7_2 99999.99
f_float_4_3 9.999
f_double_u 1.79769313486232e+308
f_float_u 3.40282e+38
f_double_u 1.7976931348623157e308
f_float_u 3.40282e38
f_double_15_1_u 99999999999999.9
f_float_3_1_u 99.9
set @value= "-1e+1111111111a";
......@@ -204,8 +204,8 @@ Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 5
original_value -1e+1111111111a
f_double -1.79769313486232e+308
f_float -3.40282e+38
f_double -1.7976931348623157e308
f_float -3.40282e38
f_double_7_2 -99999.99
f_float_4_3 -9.999
f_double_u 0
......@@ -227,13 +227,13 @@ Warning 1264 Out of range value for column 'f_double_15_1_u' at row 1
Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 6
original_value 1e+111
f_double 1e+111
f_float 3.40282e+38
original_value 1e111
f_double 1e111
f_float 3.40282e38
f_double_7_2 99999.99
f_float_4_3 9.999
f_double_u 1e+111
f_float_u 3.40282e+38
f_double_u 1e111
f_float_u 3.40282e38
f_double_15_1_u 99999999999999.9
f_float_3_1_u 99.9
set @value= -1e+111;
......@@ -248,9 +248,9 @@ Warning 1264 Out of range value for column 'f_double_15_1_u' at row 1
Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 7
original_value -1e+111
f_double -1e+111
f_float -3.40282e+38
original_value -1e111
f_double -1e111
f_float -3.40282e38
f_double_7_2 -99999.99
f_float_4_3 -9.999
f_double_u 0
......
......@@ -699,9 +699,9 @@ select * from v1a join v1b on t1.b = t2.b;
ERROR 42S22: Unknown column 't1.b' in 'on clause'
select * from information_schema.statistics join information_schema.columns
using(table_name,column_name) where table_name='user';
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL NULL BTREE NULL mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI #
user User NULL mysql 0 mysql PRIMARY 2 A 3 NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI #
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT TABLE_CATALOG TABLE_SCHEMA ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
user Host def mysql 0 mysql PRIMARY 1 A NULL NULL NULL BTREE def mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI # select,insert,update,references
user User def mysql 0 mysql PRIMARY 2 A 4 NULL NULL BTREE def mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI # select,insert,update,references
drop table t1;
drop table t2;
drop table t3;
......
......@@ -942,25 +942,29 @@ group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
drop table t1, t2;
set group_concat_max_len=default;
create table t1 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, art int(11) not null, primary key (gid,x,y));
......
......@@ -148,7 +148,7 @@ a 2
drop table t1;
create table t1 (a int not null unique, b int unique, c int, d int not null primary key, key(c), e int not null unique);
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 d A 0 NULL NULL BTREE
t1 0 a 1 a A 0 NULL NULL BTREE
t1 0 e 1 e A 0 NULL NULL BTREE
......@@ -251,13 +251,13 @@ insert t1 values ('cccc', 'tttt'),
(0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1),
(0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1);
insert t1 (c) values ('cc22');
ERROR 23000: Duplicate entry 'cc22' for key 'c'
ERROR 23000: Duplicate entry 'cc' for key 'c'
insert t1 (t) values ('ttt22');
ERROR 23000: Duplicate entry 'ttt22' for key 't'
ERROR 23000: Duplicate entry 'ttt' for key 't'
insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1);
ERROR 23000: Duplicate entry 'б!#"' for key 'c'
ERROR 23000: Duplicate entry '\0431!' for key 'c'
insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1);
ERROR 23000: Duplicate entry 'бб!#"б' for key 't'
ERROR 23000: Duplicate entry '\0431\0431!' for key 't'
select c from t1 where c='cccc';
c
cccc
......
drop table if exists t1, t2, t3;
SET @save_key_buffer=@@key_buffer_size;
SELECT @@key_buffer_size, @@small.key_buffer_size;
@@key_buffer_size @@small.key_buffer_size
1048576 0
SET @@global.key_buffer_size=16*1024*1024;
SET @@global.default.key_buffer_size=16*1024*1024;
SET @@global.default.key_buffer_size=16*1024*1024;
SET @@global.small.key_buffer_size=1*1024*1024;
SET @@global.medium.key_buffer_size=4*1024*1024;
SET @@global.medium.key_buffer_size=0;
SET @@global.medium.key_buffer_size=0;
SHOW VARIABLES like "key_buffer_size";
Variable_name Value
key_buffer_size 16777216
SELECT @@key_buffer_size;
@@key_buffer_size
16777216
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
16777216
SELECT @@global.default.key_buffer_size;
@@global.default.key_buffer_size
16777216
SELECT @@global.default.`key_buffer_size`;
@@global.default.`key_buffer_size`
16777216
SELECT @@global.`default`.`key_buffer_size`;
@@global.`default`.`key_buffer_size`
16777216
SELECT @@`default`.key_buffer_size;
@@`default`.key_buffer_size
16777216
SELECT @@small.key_buffer_size;
@@small.key_buffer_size
1048576
SELECT @@medium.key_buffer_size;
@@medium.key_buffer_size
0
SET @@global.key_buffer_size=@save_key_buffer;
SELECT @@default.key_buffer_size;
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 'default.key_buffer_size' at line 1
SELECT @@skr.storage_engine="test";
ERROR HY000: Variable 'storage_engine' is not a variable component (can't be used as XXXX.variable_name)
select @@keycache1.key_cache_block_size;
@@keycache1.key_cache_block_size
0
select @@keycache1.key_buffer_size;
@@keycache1.key_buffer_size
0
set global keycache1.key_cache_block_size=2048;
select @@keycache1.key_buffer_size;
@@keycache1.key_buffer_size
0
select @@keycache1.key_cache_block_size;
@@keycache1.key_cache_block_size
2048
set global keycache1.key_buffer_size=1*1024*1024;
select @@keycache1.key_buffer_size;
@@keycache1.key_buffer_size
1048576
select @@keycache1.key_cache_block_size;
@@keycache1.key_cache_block_size
2048
set global keycache2.key_buffer_size=4*1024*1024;
select @@keycache2.key_buffer_size;
@@keycache2.key_buffer_size
4194304
select @@keycache2.key_cache_block_size;
@@keycache2.key_cache_block_size
1024
set global keycache1.key_buffer_size=0;
select @@keycache1.key_buffer_size;
@@keycache1.key_buffer_size
0
select @@keycache1.key_cache_block_size;
@@keycache1.key_cache_block_size
2048
select @@key_buffer_size;
@@key_buffer_size
1048576
select @@key_cache_block_size;
@@key_cache_block_size
1024
set global keycache1.key_buffer_size=1024*1024;
create table t1 (p int primary key, a char(10)) delay_key_write=1;
create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a));
insert into t1 values (1, 'qqqq'), (11, 'yyyy');
insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
(3, 1, 'yyyy'), (4, 3, 'zzzz');
select * from t1;
p a
1 qqqq
11 yyyy
select * from t2;
p i a
1 1 qqqq
2 1 pppp
3 1 yyyy
4 3 zzzz
update t1 set p=2 where p=1;
update t2 set i=2 where i=1;
cache index t1 key (`primary`) in keycache1;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
explain select p from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
select p from t1;
p
2
11
explain select i from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL k1 5 NULL 4 Using index
select i from t2;
i
2
2
2
3
explain select count(*) from t1, t2 where t1.p = t2.i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index
1 SIMPLE t2 ref k1 k1 5 test.t1.p 1 Using index
select count(*) from t1, t2 where t1.p = t2.i;
count(*)
3
cache index t2 in keycache1;
Table Op Msg_type Msg_text
test.t2 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
update t2 set p=p+1000, i=2 where a='qqqq';
cache index t2 in keycache2;
Table Op Msg_type Msg_text
test.t2 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
insert into t2 values (2000, 3, 'yyyy');
cache index t2 in keycache1;
Table Op Msg_type Msg_text
test.t2 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
update t2 set p=3000 where a='zzzz';
select * from t2 order by p;
p i a
2 2 pppp
3 2 yyyy
1001 2 qqqq
2000 3 yyyy
3000 3 zzzz
explain select p from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL PRIMARY 4 NULL 5 Using index
select p from t2;
p
2
3
1001
2000
3000
explain select i from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL k1 5 NULL 5 Using index
select i from t2;
i
2
2
2
3
3
explain select a from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL k2 11 NULL 5 Using index
select a from t2;
a
pppp
qqqq
yyyy
yyyy
zzzz
cache index t1 in unknown_key_cache;
ERROR HY000: Unknown key cache 'unknown_key_cache'
cache index t1 key (unknown_key) in keycache1;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
select @@keycache2.key_buffer_size;
@@keycache2.key_buffer_size
4194304
select @@keycache2.key_cache_block_size;
@@keycache2.key_cache_block_size
1024
set global keycache2.key_buffer_size=0;
select @@keycache2.key_buffer_size;
@@keycache2.key_buffer_size
0
select @@keycache2.key_cache_block_size;
@@keycache2.key_cache_block_size
1024
set global keycache2.key_buffer_size=1024*1024;
select @@keycache2.key_buffer_size;
@@keycache2.key_buffer_size
1048576
update t2 set p=4000 where a='zzzz';
update t1 set p=p+1;
set global keycache1.key_buffer_size=0;
select * from t2 order by p;
p i a
2 2 pppp
3 2 yyyy
1001 2 qqqq
2000 3 yyyy
4000 3 zzzz
select p from t2 order by p;
p
2
3
1001
2000
4000
explain select i from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL k1 5 NULL 5 Using index
select i from t2;
i
2
2
2
3
3
explain select a from t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL k2 11 NULL 5 Using index
select a from t2;
a
pppp
qqqq
yyyy
yyyy
zzzz
select * from t1;
p a
12 yyyy
3 qqqq
select p from t1;
p
3
12
create table t3 (like t1);
cache index t3 in small;
Table Op Msg_type Msg_text
test.t3 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
insert into t3 select * from t1;
cache index t3 in keycache2;
Table Op Msg_type Msg_text
test.t3 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
cache index t1,t2 in default;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
test.t2 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache
drop table t1,t2,t3;
set global keycache2.key_buffer_size=0;
set global keycache3.key_buffer_size=100;
set global keycache3.key_buffer_size=0;
create table t1 (mytext text, FULLTEXT (mytext)) engine=myisam;
insert t1 values ('aaabbb');
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
set @my_key_cache_block_size= @@global.key_cache_block_size;
set GLOBAL key_cache_block_size=2048;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
set global key_cache_block_size= @my_key_cache_block_size;
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY);
SET @my_key_cache_block_size= @@global.key_cache_block_size;
SET GLOBAL key_cache_block_size=1536;
INSERT INTO t1 VALUES (1);
SELECT @@key_cache_block_size;
@@key_cache_block_size
1536
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
CREATE TABLE t2(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
SET GLOBAL key_cache_block_size=1536;
INSERT INTO t1 VALUES (1,0);
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
INSERT INTO t2(b) SELECT b FROM t1;
INSERT INTO t1(b) SELECT b FROM t2;
SELECT COUNT(*) FROM t1;
COUNT(*)
4181
SELECT @@key_cache_block_size;
@@key_cache_block_size
1536
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1,t2;
set global key_cache_block_size= @my_key_cache_block_size;
set @@global.key_buffer_size=0;
Warnings:
Warning 1438 Cannot drop default keycache
select @@global.key_buffer_size;
@@global.key_buffer_size
1048576
drop table if exists t1,t2;
drop table if exists t1,t2,t3;
CREATE TABLE t1 ( `id` int(11) NOT NULL default '0', `id2` int(11) NOT NULL default '0', `id3` int(11) NOT NULL default '0', `dummy1` char(30) default NULL, PRIMARY KEY (`id`,`id2`), KEY `index_id3` (`id3`)) ENGINE=MyISAM;
insert into t1 (id,id2) values (1,1),(1,2),(1,3);
LOCK TABLE t1 WRITE;
......@@ -41,13 +41,16 @@ lock tables t1 write;
check table t2;
Table Op Msg_type Msg_text
test.t2 check Error Table 't2' was not locked with LOCK TABLES
test.t2 check error Corrupt
test.t2 check status Operation failed
insert into t1 select index1,nr from t1;
ERROR HY000: Table 't1' was not locked with LOCK TABLES
unlock tables;
lock tables t1 write, t1 as t1_alias read;
insert into t1 select index1,nr from t1 as t1_alias;
drop table t1,t2;
ERROR HY000: Table 't2' was not locked with LOCK TABLES
unlock tables;
drop table t1,t2;
create table t1 (c1 int);
create table t2 (c1 int);
create table t3 (c1 int);
......@@ -69,6 +72,10 @@ ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
delete t2 from t1,t2 where t1.a=t2.a;
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
drop table t1,t2;
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
unlock tables;
drop table t2,t1;
End of 4.1 tests.
drop table if exists t1;
create table t1 (a int);
lock table t1 write;
......
......@@ -9,6 +9,7 @@ update t1,t2 set c=a where b=d;
select c from t2;
c
2
unlock tables;
drop table t1;
drop table t2;
create table t1 (a int);
......@@ -16,6 +17,7 @@ create table t2 (a int);
lock table t1 write, t2 write;
insert t1 select * from t2;
drop table t2;
unlock tables;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
create table t1 (a int);
......@@ -23,6 +25,7 @@ create table t2 (a int);
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
insert t1 select * from t2;
drop table t2;
unlock tables;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
End of 4.1 tests
......@@ -53,9 +56,10 @@ CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE;
FLUSH TABLES WITH READ LOCK;
CREATE TABLE t2 (c1 int);
ERROR HY000: Table 't2' was not locked with LOCK TABLES
UNLOCK TABLES;
UNLOCK TABLES;
DROP TABLE t1, t2;
DROP TABLE t1;
CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE;
FLUSH TABLES WITH READ LOCK;
......@@ -134,17 +138,6 @@ unlock tables;
unlock tables;
drop table t1,t2;
End of 5.0 tests
create table t1 (i int);
lock table t1 read;
update t1 set i= 10;
select * from t1;
Timeout in wait_condition.inc for select count(*) = 1 from information_schema.processlist
where state = "Locked" and info = "select * from t1"
kill query ID;
i
ERROR 70100: Query execution was interrupted
unlock tables;
drop table t1;
drop table if exists t1;
create table t1 (i int);
connection: default
......@@ -179,10 +172,11 @@ drop table if exists t1,t2;
create table t1 (a int);
flush status;
lock tables t1 read;
insert into t1 values(1);;
insert into t1 values(1);
unlock tables;
drop table t1;
select @tlwa < @tlwb;
@tlwa < @tlwb
1
End of 5.1 tests
drop database pbxt;
......@@ -2,7 +2,7 @@ drop table if exists t1,t2;
select 1, 1.0, -1, "hello", NULL;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def 1 8 1 1 N 32897 0 63
def 1.0 246 4 3 N 129 1 63
def 1.0 246 4 3 N 32897 1 63
def -1 8 2 2 N 32897 0 63
def hello 253 5 5 N 1 31 8
def NULL 6 0 0 Y 32896 0 63
......@@ -18,7 +18,7 @@ def test t1 t1 d d 3 11 0 Y 32768 0 63
def test t1 t1 e e 8 20 0 Y 32768 0 63
def test t1 t1 f f 4 3 0 Y 32768 2 63
def test t1 t1 g g 5 4 0 Y 32768 3 63
def test t1 t1 h h 246 7 0 Y 0 4 63
def test t1 t1 h h 246 7 0 Y 32768 4 63
def test t1 t1 i i 13 4 0 Y 32864 0 63
def test t1 t1 j j 10 10 0 Y 128 0 63
def test t1 t1 k k 7 19 0 N 9441 0 63
......
......@@ -93,6 +93,7 @@ Database: information_schema
| INDEX_STATISTICS |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
| PARAMETERS |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
......@@ -105,6 +106,7 @@ Database: information_schema
| SESSION_VARIABLES |
| STATISTICS |
| TABLES |
| TABLESPACES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TABLE_STATISTICS |
......@@ -112,25 +114,7 @@ Database: information_schema
| USER_PRIVILEGES |
| USER_STATISTICS |
| VIEWS |
| INNODB_BUFFER_POOL_PAGES |
| PBXT_STATISTICS |
| INNODB_CMP |
| INNODB_RSEG |
| XTRADB_ENHANCEMENTS |
| INNODB_BUFFER_POOL_PAGES_INDEX |
| XTRADB_ADMIN_COMMAND |
| INNODB_TRX |
| INNODB_SYS_TABLES |
| INNODB_LOCK_WAITS |
| INNODB_SYS_STATS |
| INNODB_LOCKS |
| INNODB_CMPMEM |
| INNODB_TABLE_STATS |
| INNODB_SYS_INDEXES |
| INNODB_CMP_RESET |
| INNODB_BUFFER_POOL_PAGES_BLOB |
| INNODB_CMPMEM_RESET |
| INNODB_INDEX_STATS |
+---------------------------------------+
Database: INFORMATION_SCHEMA
+---------------------------------------+
......@@ -150,6 +134,7 @@ Database: INFORMATION_SCHEMA
| INDEX_STATISTICS |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
| PARAMETERS |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
......@@ -162,6 +147,7 @@ Database: INFORMATION_SCHEMA
| SESSION_VARIABLES |
| STATISTICS |
| TABLES |
| TABLESPACES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TABLE_STATISTICS |
......@@ -169,25 +155,7 @@ Database: INFORMATION_SCHEMA
| USER_PRIVILEGES |
| USER_STATISTICS |
| VIEWS |
| INNODB_BUFFER_POOL_PAGES |
| PBXT_STATISTICS |
| INNODB_CMP |
| INNODB_RSEG |
| XTRADB_ENHANCEMENTS |
| INNODB_BUFFER_POOL_PAGES_INDEX |
| XTRADB_ADMIN_COMMAND |
| INNODB_TRX |
| INNODB_SYS_TABLES |
| INNODB_LOCK_WAITS |
| INNODB_SYS_STATS |
| INNODB_LOCKS |
| INNODB_CMPMEM |
| INNODB_TABLE_STATS |
| INNODB_SYS_INDEXES |
| INNODB_CMP_RESET |
| INNODB_BUFFER_POOL_PAGES_BLOB |
| INNODB_CMPMEM_RESET |
| INNODB_INDEX_STATS |
+---------------------------------------+
Wildcard: inf_rmation_schema
+--------------------+
......
......@@ -94,7 +94,7 @@ Warnings:
Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=1/NULL;
Warnings:
Warning 1265 Data truncated for column 'd' at row 1
Warning 1048 Column 'd' cannot be null
UPDATE t1 SET d=NULL;
Warnings:
Warning 1048 Column 'd' cannot be null
......
......@@ -424,6 +424,7 @@ SHOW STATUS LIKE "handler_read%";
Variable_name Value
Handler_read_first 0
Handler_read_key 6
Handler_read_last 0
Handler_read_next 2
Handler_read_prev 0
Handler_read_rnd 0
......
drop table if exists t1;
set @@session.sql_auto_is_null=1;
select {fn length("hello")}, { date "1997-10-20" };
{fn length("hello")} 1997-10-20
5 1997-10-20
......@@ -7,9 +8,9 @@ insert into t1 SET A=NULL,B=1;
insert into t1 SET a=null,b=2;
select * from t1 where a is null and b=2;
a b
2 2
select * from t1 where a is null;
a b
2 2
explain select * from t1 where b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
......
drop table if exists t1;
drop table if exists t1, t2;
partition by list (a)
partitions 3
(partition x1 values in (1,2,9,4) tablespace ts1,
......@@ -65,8 +65,8 @@ partitions 3
partition x2 tablespace ts2,
partition x3 tablespace ts3);
ERROR HY000: Field in list of fields for partition function not found in table
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -142,8 +142,8 @@ partitions 2
(partition x1 values less than (4),
partition x2 values less than (5));
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -155,8 +155,8 @@ partitions 2
(partition x1 values in (4),
partition x2 values in (5));
ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -168,8 +168,8 @@ partitions 2
(partition x1 values in (4,6),
partition x2 values in (5,7));
ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -179,8 +179,8 @@ primary key (a,b))
partition by key (a)
subpartition by key (b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -190,8 +190,8 @@ primary key (a,b))
partition by key (a)
subpartition by key (a, b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -201,8 +201,8 @@ primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -212,8 +212,8 @@ primary key (a,b))
partition by key (a)
subpartition by key (b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -223,8 +223,8 @@ primary key (a,b))
partition by key (a)
subpartition by key (a, b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -234,8 +234,8 @@ primary key (a,b))
partition by key (a)
subpartition by hash (a+b);
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -255,8 +255,8 @@ subpartition by hash (sin(a+b))
(partition x1 (subpartition x11, subpartition x12),
partition x2 (subpartition x21, subpartition x22));
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -280,8 +280,8 @@ subpartition by key (a,d)
(partition x1 values less than (1) (subpartition x11, subpartition x12),
partition x2 values less than (2) (subpartition x21, subpartition x22));
ERROR HY000: Field in list of fields for partition function not found in table
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -308,8 +308,8 @@ c int not null,
primary key(a,b))
partition by range (a);
ERROR HY000: For RANGE partitions each partition must be defined
select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par');
load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par')
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
CREATE TABLE t1 (
a int not null,
......@@ -330,8 +330,7 @@ partition by range (a)
partitions 2
(partition x1 values less than (4.0) tablespace ts1,
partition x2 values less than (8) tablespace ts2);
ERROR 42000: VALUES value must be of same type as partition function near ') tablespace ts1,
partition x2 values less than (8) tablespace ts2)' at line 8
ERROR HY000: VALUES value for partition 'x1' must have type INT
CREATE TABLE t1 (
a int not null,
b int not null,
......@@ -381,8 +380,7 @@ partition by list (a)
partitions 2
(partition x1 values less than 4,
partition x2 values less than (5));
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 '4,
partition x2 values less than (5))' at line 8
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
......@@ -392,7 +390,7 @@ partition by range (a)
partitions 2
(partition x1 values less than maxvalue,
partition x2 values less than (5));
ERROR 42000: MAXVALUE can only be used in last partition definition near '))' at line 9
ERROR HY000: MAXVALUE can only be used in last partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
......@@ -402,7 +400,7 @@ partition by range (a)
partitions 2
(partition x1 values less than maxvalue,
partition x2 values less than maxvalue);
ERROR 42000: MAXVALUE can only be used in last partition definition near 'maxvalue)' at line 9
ERROR HY000: MAXVALUE can only be used in last partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
......@@ -571,8 +569,7 @@ partition by list (a)
partitions 2
(partition x1 values in (4.0, 12+8),
partition x2 values in (3, 21));
ERROR 42000: VALUES value must be of same type as partition function near ' 12+8),
partition x2 values in (3, 21))' at line 8
ERROR HY000: VALUES value for partition 'x1' must have type INT
CREATE TABLE t1 (
a int not null,
b int not null,
......
......@@ -57,31 +57,31 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a is null or (a >= 5 and a <= 7);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 9 Using where
1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 7 Using where
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 9 Using where
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t1 where a is not null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a >= 1 and a < 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 9 Using where
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 5 Using where
explain partitions select * from t1 where a >= 3 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 9 Using where
1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 2 and a < 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 9 Using where
1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a > 3 and a <= 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 9 Using where
1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a >= 1 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 7 Using where
drop table t1;
CREATE TABLE t1 (
a int not null,
......
......@@ -21,19 +21,19 @@ select * from t1 where a > 1;
a
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 pnull ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a >= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a < 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 pnull ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a <= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
drop table t1;
create table t1 (a int unsigned, b int unsigned)
partition by range (a)
......@@ -63,19 +63,19 @@ select * from t1 where a > 1;
a b
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a >= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 6 Using where
1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a < 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a <= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 6 Using where
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
drop table t1;
CREATE TABLE t1 (
a int not null,
......
......@@ -665,30 +665,30 @@ create table t2 (s1 int, foreign key (s1) references t1 (s1)) engine = pbxt;
select * from information_schema.table_constraints
where constraint_type = 'FOREIGN KEY' and table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL test FOREIGN_1 test t2 FOREIGN KEY
def test FOREIGN_1 test t2 FOREIGN KEY
select * from information_schema.referential_constraints where table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
NULL test FOREIGN_1 NULL test PRIMARY NONE RESTRICT RESTRICT t2 t1
def test FOREIGN_1 def test PRIMARY NONE RESTRICT RESTRICT t2 t1
drop table t2, t1;
create table t1 (s1 int, s2 int, unique key ix1 (s1, s2)) engine = pbxt;
create table t2 (s1 int, s2 int, foreign key (s1, s2) references t1 (s1, s2)) engine = pbxt;
select * from information_schema.table_constraints
where constraint_type = 'FOREIGN KEY' and table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL test FOREIGN_1 test t2 FOREIGN KEY
def test FOREIGN_1 test t2 FOREIGN KEY
select * from information_schema.referential_constraints where table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
NULL test FOREIGN_1 NULL test ix1 NONE RESTRICT RESTRICT t2 t1
def test FOREIGN_1 def test ix1 NONE RESTRICT RESTRICT t2 t1
drop table t2, t1;
create table t1 (s1 int, s2 int, unique key ix1 (s1, s2), unique key ix2 (s1, s2)) engine = pbxt;
create table t2 (s1 int, s2 int, foreign key (s1, s2) references t1 (s1, s2)) engine = pbxt;
select * from information_schema.table_constraints
where constraint_type = 'FOREIGN KEY' and table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL test FOREIGN_1 test t2 FOREIGN KEY
def test FOREIGN_1 test t2 FOREIGN KEY
select * from information_schema.referential_constraints where table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
NULL test FOREIGN_1 NULL test ix1 NONE RESTRICT RESTRICT t2 t1
def test FOREIGN_1 def test ix1 NONE RESTRICT RESTRICT t2 t1
drop table t2, t1;
create table t1 (s1 int, s2 int, unique key ix1 (s1, s2)) engine = pbxt;
create table t2 (s1 int, s2 int,
......@@ -696,20 +696,20 @@ foreign key (s1, s2) references t1 (s1, s2) on delete cascade on update set null
select * from information_schema.table_constraints
where constraint_type = 'FOREIGN KEY' and table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL test FOREIGN_1 test t2 FOREIGN KEY
def test FOREIGN_1 test t2 FOREIGN KEY
select * from information_schema.referential_constraints where table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
NULL test FOREIGN_1 NULL test ix1 NONE SET NULL CASCADE t2 t1
def test FOREIGN_1 def test ix1 NONE SET NULL CASCADE t2 t1
drop table t2, t1;
create table t2 (s1 int, s2 int, s3 int, s4 int, unique key ix34 (s3, s4),
foreign key (s1, s2) references t2 (s3, s4)) engine = pbxt;
select * from information_schema.table_constraints
where constraint_type = 'FOREIGN KEY' and table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL test FOREIGN_1 test t2 FOREIGN KEY
def test FOREIGN_1 test t2 FOREIGN KEY
select * from information_schema.referential_constraints where table_name = 't2';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
NULL test FOREIGN_1 NULL test ix34 NONE RESTRICT RESTRICT t2 t2
def test FOREIGN_1 def test ix34 NONE RESTRICT RESTRICT t2 t2
drop table t2;
create table t1 (s1 int, s2 int, unique key ix1 (s1, s2)) engine = pbxt;
create table t2 (s1 int, s2 int,
......@@ -718,12 +718,12 @@ alter table t1 add constraint s2 foreign key (s1, s2) references t2 (s1, s2);
select * from information_schema.table_constraints
where constraint_type = 'FOREIGN KEY' and (table_name = 't1' or table_name = 't2');
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL test s2 test t1 FOREIGN KEY
NULL test FOREIGN_1 test t2 FOREIGN KEY
def test s2 test t1 FOREIGN KEY
def test FOREIGN_1 test t2 FOREIGN KEY
select * from information_schema.referential_constraints where (table_name = 't1' or table_name = 't2');
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
NULL test s2 NULL test s1 NONE RESTRICT RESTRICT t1 t2
NULL test FOREIGN_1 NULL test ix1 NONE RESTRICT RESTRICT t2 t1
def test s2 def test s1 NONE RESTRICT RESTRICT t1 t2
def test FOREIGN_1 def test ix1 NONE RESTRICT RESTRICT t2 t1
set foreign_key_checks = 0;
drop table t2, t1;
set foreign_key_checks = 1;
......@@ -731,10 +731,10 @@ create table t1 (id int primary key, s1 int, foreign key (s1) references t1 (id)
select * from information_schema.table_constraints
where constraint_type = 'FOREIGN KEY' and table_name = 't1';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL test FOREIGN_1 test t1 FOREIGN KEY
def test FOREIGN_1 test t1 FOREIGN KEY
select * from information_schema.referential_constraints where table_name = 't1';
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
NULL test FOREIGN_1 NULL test PRIMARY NONE RESTRICT RESTRICT t1 t1
def test FOREIGN_1 def test PRIMARY NONE RESTRICT RESTRICT t1 t1
drop table t1;
drop table if exists t2,t1;
create table t1 (s1 int primary key) engine = pbxt;
......
......@@ -40,6 +40,8 @@ end|
call bug7049_2()|
Result
Caught it
Warnings:
Error 1062 Duplicate entry '42' for key 'x'
drop procedure bug7049_1|
drop function bug7049_1|
drop procedure bug7049_2|
......
......@@ -529,10 +529,14 @@ end|
call t3_update()|
t3_update
Inner (good)
Warnings:
Error 1062 Duplicate entry '1' for key 'PRIMARY'
begin|
call t3_update()|
t3_update
Inner (good)
Warnings:
Error 1062 Duplicate entry '1' for key 'PRIMARY'
commit|
drop table if exists t3|
drop procedure if exists t3_update|
......
......@@ -263,6 +263,7 @@ information_schema
mtr
mysql
pbxt
performance_schema
test
prepare stmt4 from ' show tables from test like ''t2%'' ';
execute stmt4;
......@@ -280,6 +281,9 @@ b char(10) YES NULL
SET @arg00=1;
execute stmt4 using @arg00;
Field Type Null Key Default Extra
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'a'
Warning 1292 Truncated incorrect DOUBLE value: 'b'
prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
execute stmt4;
Field Type Null Key Default Extra
......@@ -287,7 +291,7 @@ a int(11) NO PRI NULL
create index t2_idx on t2(b);
prepare stmt4 from ' show index from t2 from test ';
execute stmt4;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t2 0 PRIMARY 1 a A 0 NULL NULL BTREE
t2 1 t2_idx 1 b A 0 NULL NULL YES BTREE
prepare stmt4 from ' show table status from test like ''t2%'' ';
......@@ -306,8 +310,9 @@ prepare stmt4 from ' show variables like ''sql_mode'' ';
execute stmt4;
Variable_name Value
sql_mode
prepare stmt4 from ' show engine pbxt logs ';
prepare stmt4 from ' show engine myisam logs ';
execute stmt4;
Type Name Status
prepare stmt4 from ' show grants for user ';
prepare stmt4 from ' show create table t2 ';
prepare stmt4 from ' show master status ';
......@@ -400,17 +405,15 @@ prepare stmt3 from ' lock tables t1 read ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from ' unlock tables ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' load data infile ''data.txt''
into table t1 fields terminated by ''\t'' ';
prepare stmt1 from ' load data infile ''<MYSQLTEST_VARDIR>/tmp/data.txt''
into table t1 fields terminated by ''\t'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' select * into outfile ''data.txt'' from t1 ';
prepare stmt1 from ' select * into outfile ''<MYSQLTEST_VARDIR>/tmp/data.txt'' from t1 ';
execute stmt1 ;
prepare stmt1 from ' optimize table t1 ' ;
prepare stmt1 from ' analyze table t1 ' ;
prepare stmt1 from ' checksum table t1 ' ;
prepare stmt1 from ' repair table t1 ' ;
prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' handler t1 open ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from ' commit ' ;
......
......@@ -55,8 +55,7 @@ my_col
execute s_t9 ;
ERROR 42S02: Table 'mysqltest.t9' doesn't exist
deallocate prepare s_t9;
revoke all privileges on mysqltest.t1 from second_user@localhost
identified by 'looser' ;
revoke all privileges on mysqltest.t1 from second_user@localhost;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
......
......@@ -55,14 +55,16 @@ t2
t4
drop table t2, t4;
End of 4.1 tests
#
# Bug#14959: "ALTER TABLE isn't able to rename a view"
# Bug#53976: "ALTER TABLE RENAME is allowed on views
# (not documented, broken)"
#
create table t1(f1 int);
create view v1 as select * from t1;
alter table v1 rename to v2;
alter table v1 rename to v2;
ERROR 42S02: Table 'test.v1' doesn't exist
rename table v2 to v1;
rename table v2 to v1;
ERROR 42S01: Table 'v1' already exists
ERROR HY000: 'test.v1' is not BASE TABLE
drop view v1;
drop table t1;
End of 5.0 tests
drop database pbxt;
......@@ -11,5 +11,6 @@ foo
mtr
mysql
pbxt
performance_schema
test
drop schema foo;
......@@ -185,37 +185,37 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index
select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
fld1 fld3
218401 faithful
012001 flanking
013602 foldout
013606 fingerings
018007 fanatic
228311 fated
018017 featherweight
218022 feed
088303 feminine
058004 Fenton
038017 fetched
018054 fetters
208101 fiftieth
238007 filial
013606 fingerings
218008 finishers
038205 firearm
188505 fitting
202301 Fitzpatrick
238008 fixedly
012001 flanking
018103 flint
018104 flopping
036002 funereal
038017 fetched
038205 firearm
058004 Fenton
088303 feminine
186002 freakish
188007 flurried
013602 foldout
188505 fitting
198006 furthermore
202301 Fitzpatrick
208101 fiftieth
208113 freest
218008 finishers
218022 feed
218401 faithful
226205 foothill
232102 forgivably
226209 furnishings
228306 forthcoming
186002 freakish
208113 freest
228311 fated
231315 freezes
036002 funereal
226209 furnishings
198006 furthermore
232102 forgivably
238007 filial
238008 fixedly
select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
fld3
select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
......@@ -2092,7 +2092,7 @@ fld6 char(4) latin1_swedish_ci NO #
show full columns from t2 from test like 's%';
Field Type Collation Null Key Default Extra Privileges Comment
show keys from t2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
t2 1 fld3 1 fld3 A 1199 NULL NULL BTREE
......@@ -2264,20 +2264,20 @@ a
3
select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1;
a a
NULL 1
1 2
2 2
3 2
1 3
2 2
2 3
3 2
3 3
NULL 1
select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
a a
2 1
3 1
2 2
3 2
2 3
3 1
3 2
3 3
select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a );
a
......@@ -2432,27 +2432,28 @@ city
London
DROP TABLE t1;
create table t1 (a int(11) unsigned, b int(11) unsigned);
insert into t1 values (1,0), (1,1), (1,2);
insert into t1 values (1,0), (1,1), (18446744073709551615,0);
Warnings:
Warning 1264 Out of range value for column 'a' at row 3
select a-b from t1 order by 1;
a-b
0
1
18446744073709551615
4294967295
select a-b , (a-b < 0) from t1 order by 1;
a-b (a-b < 0)
0 0
1 0
18446744073709551615 0
4294967295 0
select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
d (a-b >= 0) b
1 1 0
0 1 1
18446744073709551615 1 2
select cast((a - b) as unsigned) from t1 order by 1;
cast((a - b) as unsigned)
0
1
18446744073709551615
4294967295
drop table t1;
create table t1 (a int(11));
select all all * from t1;
......@@ -2792,26 +2793,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(key1) from t1 where key1 <= 0.6158;
max(key1)
0.615800023078918
0.6158000230789185
select max(key2) from t2 where key2 <= 1.6158;
max(key2)
1.61580002307892
1.6158000230789185
select min(key1) from t1 where key1 >= 0.3762;
min(key1)
0.376199990510941
0.37619999051094055
select min(key2) from t2 where key2 >= 1.3762;
min(key2)
1.37619996070862
1.3761999607086182
select max(key1), min(key2) from t1, t2
where key1 <= 0.6158 and key2 >= 1.3762;
max(key1) min(key2)
0.615800023078918 1.37619996070862
0.6158000230789185 1.3761999607086182
select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
max(key1)
0.615800023078918
0.6158000230789185
select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
0.376199990510941
0.37619999051094055
DROP TABLE t1,t2;
CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
INSERT INTO t1 VALUES (10);
......@@ -3241,37 +3242,37 @@ drop table t1, t2 ,t3;
create table t1(f1 int, f2 date);
insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
(4,'2005-10-01'),(5,'2005-12-30');
select * from t1 where f2 >= 0;
select * from t1 where f2 >= 0 order by f2;
f1 f2
1 2005-01-01
2 2005-09-01
3 2005-09-30
4 2005-10-01
5 2005-12-30
select * from t1 where f2 >= '0000-00-00';
select * from t1 where f2 >= '0000-00-00' order by f2;
f1 f2
1 2005-01-01
2 2005-09-01
3 2005-09-30
4 2005-10-01
5 2005-12-30
select * from t1 where f2 >= '2005-09-31';
select * from t1 where f2 >= '2005-09-31' order by f2;
f1 f2
4 2005-10-01
5 2005-12-30
select * from t1 where f2 >= '2005-09-3a';
select * from t1 where f2 >= '2005-09-3a' order by f2;
f1 f2
3 2005-09-30
4 2005-10-01
5 2005-12-30
Warnings:
Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
select * from t1 where f2 <= '2005-09-31';
select * from t1 where f2 <= '2005-09-31' order by f2;
f1 f2
1 2005-01-01
2 2005-09-01
3 2005-09-30
select * from t1 where f2 <= '2005-09-3a';
select * from t1 where f2 <= '2005-09-3a' order by f2;
f1 f2
1 2005-01-01
2 2005-09-01
......@@ -3419,6 +3420,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where
DROP TABLE t1,t2;
SET SQL_MODE='NO_UNSIGNED_SUBTRACTION';
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
......@@ -3438,8 +3440,9 @@ Warnings:
Warning 1264 Out of range value for column 'i' at row 1
SELECT * FROM t1;
i
255
0
DROP TABLE t1;
SET SQL_MODE=default;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, c int, e int, primary key(a,b,c));
......@@ -3542,12 +3545,6 @@ id a b c d e
2 NULL NULL NULL 2 40
2 NULL NULL NULL 2 50
DROP TABLE t1,t2,t3;
create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int,
c7 int, c8 int, c9 int, fulltext key (`c1`)) engine=myisam;
select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8
from t1 where c9=1 order by c2, c2;
match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8
drop table t1;
CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16));
CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10));
INSERT INTO t1 VALUES
......
drop table if exists t1,t2;
SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead
create table t1 (a int auto_increment primary key, b char(20));
insert into t1 values(1,"test");
SELECT SQL_BUFFER_RESULT * from t1;
......@@ -96,3 +98,5 @@ select * from (select 1 union select 2 union select 3) x;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
drop table t1;
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead
flush status;
show status like 'Table_lock%';
Variable_name Value
Table_locks_immediate 1
Table_locks_immediate 0
Table_locks_waited 0
select * from information_schema.session_status where variable_name like 'Table_lock%';
VARIABLE_NAME VARIABLE_VALUE
TABLE_LOCKS_IMMEDIATE 2
TABLE_LOCKS_IMMEDIATE 0
TABLE_LOCKS_WAITED 0
SET SQL_LOG_BIN=0;
drop table if exists t1;
......@@ -21,11 +21,11 @@ update t1 set n = 3;
unlock tables;
show status like 'Table_lock%';
Variable_name Value
Table_locks_immediate 17
Table_locks_immediate 4
Table_locks_waited 1
select * from information_schema.session_status where variable_name like 'Table_lock%';
VARIABLE_NAME VARIABLE_VALUE
TABLE_LOCKS_IMMEDIATE 18
TABLE_LOCKS_IMMEDIATE 4
TABLE_LOCKS_WAITED 1
drop table t1;
select 1;
......@@ -100,7 +100,7 @@ Variable_name Value
Com_show_status 3
show status like 'hand%write%';
Variable_name Value
Handler_write 5
Handler_write 0
show status like '%tmp%';
Variable_name Value
Created_tmp_disk_tables 0
......@@ -108,7 +108,7 @@ Created_tmp_files 0
Created_tmp_tables 0
show status like 'hand%write%';
Variable_name Value
Handler_write 7
Handler_write 0
show status like '%tmp%';
Variable_name Value
Created_tmp_disk_tables 0
......
This diff is collapsed.
......@@ -47,7 +47,7 @@ create table t1 (s1 binary(2) primary key);
insert into t1 values (0x01);
insert into t1 values (0x0120);
insert into t1 values (0x0100);
ERROR 23000: Duplicate entry '' for key 'PRIMARY'
ERROR 23000: Duplicate entry '\x01' for key 'PRIMARY'
select hex(s1) from t1 order by s1;
hex(s1)
0100
......
......@@ -71,7 +71,7 @@ hex(a)
1
1
alter table t1 add unique (a);
ERROR 23000: Duplicate entry '' for key 'a'
ERROR 23000: Duplicate entry '\x00' for key 'a'
drop table t1;
create table t1 (a bit(2));
insert into t1 values (b'00'), (b'01'), (b'10'), (b'100');
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -192,8 +192,6 @@ coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4)
2 2 2 2
set session @honk=99;
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 '@honk=99' at line 1
set one_shot @honk=99;
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
select @@local.max_allowed_packet;
@@local.max_allowed_packet
#
......
This diff is collapsed.
......@@ -10,7 +10,7 @@ create table t1 (a int check (a>0));
insert into t1 values (1);
insert into t1 values (0);
drop table t1;
create table t1 (a int ,b int, check a>b);
create table t1 (a int, b int, check (a>b));
insert into t1 values (1,0);
insert into t1 values (0,1);
drop table t1;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment