Commit a90934f3 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Imported Upstream version 5.5.46

parent 3f8c7c93
...@@ -84,7 +84,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); ...@@ -84,7 +84,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
ERROR HY000: Incorrect usage of PROCEDURE and subquery ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
ERROR HY000: Incorrect parameters to procedure 'ANALYSE' ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
ERROR 42S22: Unknown column 'a' in 'field list' ERROR 42S22: Unknown column 'a' in 'field list'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
...@@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; ...@@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
drop table t1, t2; drop table t1, t2;
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause' ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause' ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
...@@ -7010,5 +7010,71 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); ...@@ -7010,5 +7010,71 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1)) exists(select 1 from t1 group by `c` in (select `c` from t1))
0 0
drop table t1; drop table t1;
#
# MDEV-7565: Server crash with Signal 6 (part 2)
#
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
ControlRev
NULL
#
# MDEV-7445:Server crash with Signal 6
#
CREATE PROCEDURE procedure2()
BEGIN
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
END |
call procedure2();
ControlRev
NULL
call procedure2();
ControlRev
NULL
drop procedure procedure2;
SELECT
(SELECT user FROM mysql.user
WHERE h.host in (SELECT host FROM mysql.user)
) AS sq
FROM mysql.host h GROUP BY h.host;
sq
#
# MDEV-7846:Server crashes in Item_subselect::fix
#_fields or fails with Thread stack overrun
#
CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (3),(9);
CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1),(4);
CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
INSERT INTO t3 VALUES (6),(8);
CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
INSERT INTO t4 VALUES (2),(5);
PREPARE stmt FROM "
SELECT (
SELECT MAX( table1.column1 ) AS field1
FROM t1 AS table1
WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
) AS sq
FROM t3 AS table3, t4 AS table4 GROUP BY sq
";
EXECUTE stmt;
sq
NULL
EXECUTE stmt;
sq
NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
set @optimizer_switch_for_subselect_test=null; set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL; set @join_cache_level_for_subselect_test=NULL;
...@@ -2185,4 +2185,22 @@ drop database mysqltest1; ...@@ -2185,4 +2185,22 @@ drop database mysqltest1;
drop database mysqltest2; drop database mysqltest2;
drop database mysqltest3; drop database mysqltest3;
drop database mysqltest4; drop database mysqltest4;
#
# MDEV-7810 Wrong result on execution of a query as a PS
# (both 1st and further executions)
CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM;
INSERT INTO t1 VALUES (0),(8);
SELECT a FROM (SELECT DISTINCT * FROM t1) AS sq WHERE a IN (SELECT MIN(t2.a) FROM (t1 AS t2));
a
0
PREPARE stmt FROM "
SELECT a FROM (SELECT DISTINCT * FROM t1) AS sq WHERE a IN (SELECT MIN(t2.a) FROM (t1 AS t2))
";
execute stmt;
a
0
execute stmt;
a
0
drop table t1;
# End of 5.5 tests # End of 5.5 tests
...@@ -561,6 +561,21 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function ...@@ -561,6 +561,21 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function
DROP VIEW v1; DROP VIEW v1;
DROP FUNCTION f1; DROP FUNCTION f1;
DROP TABLE t1; DROP TABLE t1;
# Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT
# RESULTS
CREATE TABLE t1 (a VARCHAR(50), b TEXT, c CHAR(50)) ENGINE=INNODB;
INSERT INTO t1 (a, b, c) VALUES ('start trail', '', 'even longer string');
UPDATE t1 SET b = a, a = 'inject';
SELECT a, b FROM t1;
a b
inject start trail
UPDATE t1 SET b = c, c = 'inject';
SELECT c, b FROM t1;
c b
inject even longer string
DROP TABLE t1;
#
# MDEV-3948 Assertion `records_are_comparable(table)' fails in compare_record(const TABLE*) on UPDATE with simple AND condition, index_merge+index_merge_intersection, InnoDB
# #
# Verify that UPDATE does the same number of handler_update # Verify that UPDATE does the same number of handler_update
# operations, no matter if there is ORDER BY or not. # operations, no matter if there is ORDER BY or not.
......
...@@ -4830,6 +4830,41 @@ View Create View character_set_client collation_connection ...@@ -4830,6 +4830,41 @@ View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `col2`) union all (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `col2`) union all (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci
DROP VIEW v1, v2, v3, v4, v5; DROP VIEW v1, v2, v3, v4, v5;
# #
# BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION,
# IS REJECTED
# Without the patch, reports an error.
CREATE VIEW v1 (fld1, fld2) AS
SELECT 1 AS a, 2 AS b
UNION ALL
SELECT 1 AS a, 1 AS a;
# The column names are explicitly specified and not duplicates, hence
# succeeds.
CREATE VIEW v2 (fld1, fld2) AS
SELECT 1 AS a, 2 AS a
UNION ALL
SELECT 1 AS a, 1 AS a;
# The column name in the first SELECT are not duplicates, hence succeeds.
CREATE VIEW v3 AS
SELECT 1 AS a, 2 AS b
UNION ALL
SELECT 1 AS a, 1 AS a;
# Should report an error, since the explicitly specified column names are
# duplicates.
CREATE VIEW v4 (fld1, fld1) AS
SELECT 1 AS a, 2 AS b
UNION ALL
SELECT 1 AS a, 1 AS a;
ERROR 42S21: Duplicate column name 'fld1'
# Should report an error, since duplicate column name is specified in the
# First SELECT.
CREATE VIEW v4 AS
SELECT 1 AS a, 2 AS a
UNION ALL
SELECT 1 AS a, 1 AS a;
ERROR 42S21: Duplicate column name 'a'
# Cleanup
DROP VIEW v1, v2, v3;
#
# lp:833600 Wrong result with view + outer join + uncorrelated subquery (non-semijoin) # lp:833600 Wrong result with view + outer join + uncorrelated subquery (non-semijoin)
# #
CREATE TABLE t1 ( a int, b int ); CREATE TABLE t1 ( a int, b int );
...@@ -5429,6 +5464,21 @@ View Create View character_set_client collation_connection ...@@ -5429,6 +5464,21 @@ View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci
drop view v2; drop view v2;
drop table t1; drop table t1;
#
# MDEV-8554: Server crashes in base_list_iterator::next_fast on 1st execution of PS with a multi-table update
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (3),(4);
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
INSERT INTO t3 VALUES (5),(6);
CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
PREPARE stmt FROM 'UPDATE t1, t2 SET a = 1 WHERE a IN ( SELECT 0 FROM t3 )';
UPDATE t1, t2 SET a = 1 WHERE a IN ( SELECT 0 FROM v3 );
EXECUTE stmt;
DROP TABLE t1, t2, t3;
DROP VIEW v3;
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# -- End of 5.5 tests. # -- End of 5.5 tests.
# ----------------------------------------------------------------- # -----------------------------------------------------------------
......
<test_rows>
<row>
<col1>0bc</col1>
<col2>def</col2>
<col3>ghi</col3>
<col4>jkl</col4>
</row>
<row>
<col1>1no</col1>
<col2/>
<col3>pqr</col3>
<col4>stu</col4>
</row>
<row>
<col1>2BC</col1>
<col2>DEF</col2>
<col3>GHI</col3>
<col4>JKL</col4>
</row>
<row>
<col1>3NO</col1>
<col2 />
<col3>PQR</col3>
<col4>STU</col4>
</row>
<row col1="4bc" col2="def" col3="ghi" col4="jkl"/>
<row col1="5no" col2="pqr" col3="stu" col4="vwx" />
<row>
<field name='col1'>6BC</field>
<field name='col2'>DEF</field>
<field name='col3'></field>
<field name='col4'>JKL</field>
</row>
<row>
<field name='col1'>7NO</field>
<field name='col2'>PQR</field>
<field name='col3'>STU</field>
<field name='col4'>VWX</field>
</row>
<row>
<col1>8bc</col1>
<col2>def</col2>
<col3>ghi</col3>
<col4 />
</row>
<row>
<col1>9kl</col1>
<col2/>
<col3>mno</col3>
<col4>pqr</col4>
</row>
<row col1="ABC" col2="DEF" col3="" col4="JKL"/>
<row col1="MNO" col2="" col3="STU" col4="VWX"/>
</test_rows>
<test_rows>
<row>
<col1>ABC</col1>
<col2>DEF</col2>
<col3 />
</row>
<row>
<col1>GHI</col1>
<col2 />
<col3>123</col3>
</row>
</test_rows>
...@@ -1409,7 +1409,7 @@ BEGIN ...@@ -1409,7 +1409,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1` ### INSERT INTO `test`.`t1`
### SET ### SET
### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ ### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
...@@ -1426,7 +1426,7 @@ BEGIN ...@@ -1426,7 +1426,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1` ### INSERT INTO `test`.`t1`
### SET ### SET
### @1=-000000543.210000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ ### @1=-543.21000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
...@@ -1443,7 +1443,7 @@ BEGIN ...@@ -1443,7 +1443,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1` ### DELETE FROM `test`.`t1`
### WHERE ### WHERE
### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ ### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
......
...@@ -2390,9 +2390,9 @@ BEGIN ...@@ -2390,9 +2390,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2483,9 +2483,9 @@ BEGIN ...@@ -2483,9 +2483,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2659,9 +2659,9 @@ BEGIN ...@@ -2659,9 +2659,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2752,9 +2752,9 @@ BEGIN ...@@ -2752,9 +2752,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2832,9 +2832,9 @@ BEGIN ...@@ -2832,9 +2832,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2925,9 +2925,9 @@ BEGIN ...@@ -2925,9 +2925,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3005,9 +3005,9 @@ BEGIN ...@@ -3005,9 +3005,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3178,9 +3178,9 @@ BEGIN ...@@ -3178,9 +3178,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3271,9 +3271,9 @@ BEGIN ...@@ -3271,9 +3271,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3444,9 +3444,9 @@ BEGIN ...@@ -3444,9 +3444,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3537,9 +3537,9 @@ BEGIN ...@@ -3537,9 +3537,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3630,9 +3630,9 @@ BEGIN ...@@ -3630,9 +3630,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
......
...@@ -2390,9 +2390,9 @@ BEGIN ...@@ -2390,9 +2390,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2485,9 +2485,9 @@ BEGIN ...@@ -2485,9 +2485,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2663,9 +2663,9 @@ BEGIN ...@@ -2663,9 +2663,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2758,9 +2758,9 @@ BEGIN ...@@ -2758,9 +2758,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2838,9 +2838,9 @@ BEGIN ...@@ -2838,9 +2838,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -2933,9 +2933,9 @@ BEGIN ...@@ -2933,9 +2933,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3013,9 +3013,9 @@ BEGIN ...@@ -3013,9 +3013,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3188,9 +3188,9 @@ BEGIN ...@@ -3188,9 +3188,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3283,9 +3283,9 @@ BEGIN ...@@ -3283,9 +3283,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3458,9 +3458,9 @@ BEGIN ...@@ -3458,9 +3458,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3553,9 +3553,9 @@ BEGIN ...@@ -3553,9 +3553,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
...@@ -3648,9 +3648,9 @@ BEGIN ...@@ -3648,9 +3648,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
......
...@@ -258,7 +258,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back ...@@ -258,7 +258,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
create table t0 (n int); create table t0 (n int);
insert t0 select * from t1; insert t0 select * from t1;
set autocommit=1; set autocommit=1;
insert into t0 select GET_LOCK("lock1",null); insert into t0 select GET_LOCK("lock1",0);
set autocommit=0; set autocommit=0;
create table t2 (n int) engine=innodb; create table t2 (n int) engine=innodb;
insert into t2 values (3); insert into t2 values (3);
......
...@@ -242,7 +242,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back ...@@ -242,7 +242,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
create table t0 (n int); create table t0 (n int);
insert t0 select * from t1; insert t0 select * from t1;
set autocommit=1; set autocommit=1;
insert into t0 select GET_LOCK("lock1",null); insert into t0 select GET_LOCK("lock1",0);
Warnings: Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
set autocommit=0; set autocommit=0;
...@@ -288,7 +288,7 @@ master-bin.000001 # Query # # BEGIN ...@@ -288,7 +288,7 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert t0 select * from t1 master-bin.000001 # Query # # use `test`; insert t0 select * from t1
master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",null) master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",0)
master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti` master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti`
......
#
# Bug #20762798 FK DDL: CRASH IN DICT_FOREIGN_REMOVE_FROM_CACHE
#
create table t1(a int, b int, key(a),key(b))engine=innodb;
create table t2(a int, b int, key(a),key(b))engine=innodb;
alter table t2 add constraint b foreign key (b) references t1(a);
alter table t1 add constraint b1 foreign key (b) references t2(a);
alter table t2 add constraint b1 foreign key (b) references t1(a);
ERROR HY000: Can't create table '#sql-temporary' (errno: 121)
alter table t2 drop foreign key b;
alter table t1 drop foreign key b1;
drop table t2;
drop table t1;
CREATE TABLE t1 (
id int(11) NOT NULL PRIMARY KEY,
a int(11) NOT NULL,
b int(11) NOT NULL,
c int not null,
CONSTRAINT test FOREIGN KEY (b) REFERENCES t1 (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE t2 (
id int(11) NOT NULL PRIMARY KEY,
a int(11) NOT NULL,
b int(11) NOT NULL,
c int not null,
CONSTRAINT mytest FOREIGN KEY (c) REFERENCES t1(id),
CONSTRAINT test FOREIGN KEY (b) REFERENCES t2 (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ERROR HY000: Can't create table 'test.t2' (errno: 121)
show warnings;
Level Code Message
Warning 121 Create or Alter table `test`.`t2` with foreign key constraint failed. Foreign key constraint `test/test` already exists on data dictionary. Foreign key constraint names need to be unique in database. Error in foreign key definition: CONSTRAINT `test` FOREIGN KEY (`b`) REFERENCES `test`.`t2` (`id`).
Error 1005 Can't create table 'test.t2' (errno: 121)
drop table t1;
create table t1(a int) engine=innodb;
create table t2(a int, constraint a foreign key a (a) references t1(a)) engine=innodb;
ERROR HY000: Can't create table 'test.t2' (errno: 150)
show warnings;
Level Code Message
Warning 150 Create table '`test`.`t2`' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns. Error close to foreign key a (a) references t1(a)) engine=innodb.
Error 1005 Can't create table 'test.t2' (errno: 150)
drop table t1;
create table t1(a int not null primary key, b int) engine=innodb;
create table t2(a int, b int, constraint a foreign key a (a) references t1(a),
constraint a foreign key a (a) references t1(b)) engine=innodb;
ERROR HY000: Can't create table 'test.t2' (errno: 150)
show warnings;
Level Code Message
Warning 150 Create table '`test`.`t2`' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns. Error close to foreign key a (a) references t1(b)) engine=innodb.
Error 1005 Can't create table 'test.t2' (errno: 150)
create table t2(a int, b int, constraint a foreign key a (a) references t1(a)) engine=innodb;
alter table t2 add constraint b foreign key (b) references t2(b);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
show warnings;
Level Code Message
Warning 150 Alter table '`test`.`t2`' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns. Error close to foreign key (b) references t2(b).
Error 1005 Can't create table '#sql-temporary' (errno: 150)
drop table t2, t1;
create table t1 (f1 integer primary key) engine=innodb;
alter table t1 add constraint c1 foreign key (f1) references t11(f1);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
show warnings;
Level Code Message
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Referenced table `test`.`t11` not found in the data dictionary close to foreign key (f1) references t11(f1).
Error 1005 Can't create table '#sql-temporary' (errno: 150)
drop table t1;
create temporary table t1(a int not null primary key, b int, key(b)) engine=innodb;
create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
ERROR HY000: Can't create table 'test.t2' (errno: 150)
show warnings;
Level Code Message
Warning 150 Create table `mysqld.1`.`t2` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary close to foreign key(a) references t1(a)) engine=innodb.
Error 1005 Can't create table 'test.t2' (errno: 150)
alter table t1 add foreign key(b) references t1(a);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
show warnings;
Level Code Message
Warning 150 Alter table `mysqld.1`.`t1` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary close to foreign key(b) references t1(a).
Error 1005 Can't create table '#sql-temporary' (errno: 150)
drop table t1;
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
alter table t1 add foreign key(a,b) references t1(a);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
show warnings;
Level Code Message
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Foreign key constraint parse error in foreign key(a,b) references t1(a) close to ). Too few referenced columns, you have 1 when you should have 2.
Error 1005 Can't create table '#sql-temporary' (errno: 150)
drop table t1;
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
alter table t1 add foreign key(a) references t1(a,b);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
show warnings;
Level Code Message
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Foreign key constraint parse error in foreign key(a) references t1(a,b) close to ). Too few referenced columns, you have 2 when you should have 1.
Error 1005 Can't create table '#sql-temporary' (errno: 150)
drop table t1;
create table t1 (f1 integer not null primary key) engine=innodb;
alter table t1 add constraint c1 foreign key (f1) references t1(f1) on update set null;
ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
show warnings;
Level Code Message
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. You have defined a SET NULL condition but column f1 is defined as NOT NULL in foreign key (f1) references t1(f1) on update set null close to on update set null.
Error 1005 Can't create table '#sql-temporary' (errno: 150)
create table t2(a int not null, foreign key(a) references t1(f1) on delete set null) engine=innodb;
ERROR HY000: Can't create table 'test.t2' (errno: 150)
show warnings;
Level Code Message
Warning 150 Create table `test`.`t2` with foreign key constraint failed. You have defined a SET NULL condition but column a is defined as NOT NULL in foreign key(a) references t1(f1) on delete set null) engine=innodb close to on delete set null) engine=innodb.
Error 1005 Can't create table 'test.t2' (errno: 150)
drop table t1;
create table t1 (id int not null primary key, f1 int, f2 int, key(f1)) engine=innodb;
create table t2(a char(20), key(a), foreign key(a) references t1(f1)) engine=innodb;
ERROR HY000: Can't create table 'test.t2' (errno: 150)
show warnings;
Level Code Message
Warning 150 Create table `test`.`t2` with foreign key constraint failed. Field type or character set for column a does not mach referenced column f1 close to foreign key(a) references t1(f1)) engine=innodb
Error 1005 Can't create table 'test.t2' (errno: 150)
drop table t1;
...@@ -50,6 +50,8 @@ CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE ...@@ -50,6 +50,8 @@ CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE
ERROR HY000: Can't create table 'test.t2' (errno: 150) ERROR HY000: Can't create table 'test.t2' (errno: 150)
show warnings; show warnings;
Level Code Message Level Code Message
Warning 150 Create table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary close to FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE
) ENGINE=InnoDB.
Error 1005 Can't create table 'test.t2' (errno: 150) Error 1005 Can't create table 'test.t2' (errno: 150)
CREATE TABLE t2 ( CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
...@@ -62,6 +64,7 @@ ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE ...@@ -62,6 +64,7 @@ ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE
ERROR HY000: Can't create table '#sql-temporary' (errno: 150) ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
show warnings; show warnings;
Level Code Message Level Code Message
Warning 150 Alter table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary close to FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE.
Error 1005 Can't create table '#sql-temporary' (errno: 150) Error 1005 Can't create table '#sql-temporary' (errno: 150)
drop table t2; drop table t2;
drop table t1; drop table t1;
set global innodb_file_per_table=1;
CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
CREATE TABLE `main` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ref_id1` int(11) NOT NULL,
`ref_id2` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_1` (`ref_id1`,`ref_id2`),
KEY `FK_set_out_analysis_route_id` (`ref_id2`),
CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`) ,
CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`)
) ENGINE=InnoDB;
SET FOREIGN_KEY_CHECKS=0;
DROP INDEX `idx_1` ON `main`;
SHOW TABLES;
Tables_in_test
main
ref_table1
ref_table2
# restart and see if we can still access the main table
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`);
SHOW CREATE TABLE `main`;
Table Create Table
main CREATE TABLE `main` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ref_id1` int(11) NOT NULL,
`ref_id2` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_set_out_analysis_route_id` (`ref_id2`),
KEY `idx_1` (`ref_id1`),
CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`),
CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE main, ref_table1, ref_table2;
install plugin innodb soname 'ha_innodb';
create table t1(a int not null primary key) engine=innodb;
begin;
insert into t1 values(1);
flush tables;
uninstall plugin innodb;
select sleep(1);
sleep(1)
0
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
drop table t1;
install plugin innodb soname 'ha_innodb';
create table t2(a int not null primary key) engine=innodb;
insert into t2 values(1);
drop table t2;
uninstall plugin innodb;
select sleep(1);
sleep(1)
0
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
--source include/have_innodb.inc
--echo #
--echo # Bug #20762798 FK DDL: CRASH IN DICT_FOREIGN_REMOVE_FROM_CACHE
--echo #
create table t1(a int, b int, key(a),key(b))engine=innodb;
create table t2(a int, b int, key(a),key(b))engine=innodb;
alter table t2 add constraint b foreign key (b) references t1(a);
alter table t1 add constraint b1 foreign key (b) references t2(a);
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_CANT_CREATE_TABLE
alter table t2 add constraint b1 foreign key (b) references t1(a);
alter table t2 drop foreign key b;
alter table t1 drop foreign key b1;
drop table t2;
drop table t1;
--source include/have_innodb.inc
#
# MDEV-8524: Improve error messaging when there is duplicate key or foreign key names
#
CREATE TABLE t1 (
id int(11) NOT NULL PRIMARY KEY,
a int(11) NOT NULL,
b int(11) NOT NULL,
c int not null,
CONSTRAINT test FOREIGN KEY (b) REFERENCES t1 (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
#
# Below create table fails because constraint name test
# is reserved for above table.
#
--error 1005
CREATE TABLE t2 (
id int(11) NOT NULL PRIMARY KEY,
a int(11) NOT NULL,
b int(11) NOT NULL,
c int not null,
CONSTRAINT mytest FOREIGN KEY (c) REFERENCES t1(id),
CONSTRAINT test FOREIGN KEY (b) REFERENCES t2 (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
show warnings;
drop table t1;
#
# MDEV-6697: Improve foreign keys warnings/errors
#
#
# No index for referenced columns
#
create table t1(a int) engine=innodb;
--error 1005
create table t2(a int, constraint a foreign key a (a) references t1(a)) engine=innodb;
show warnings;
drop table t1;
create table t1(a int not null primary key, b int) engine=innodb;
--error 1005
create table t2(a int, b int, constraint a foreign key a (a) references t1(a),
constraint a foreign key a (a) references t1(b)) engine=innodb;
show warnings;
create table t2(a int, b int, constraint a foreign key a (a) references t1(a)) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
alter table t2 add constraint b foreign key (b) references t2(b);
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
drop table t2, t1;
#
# Referenced table does not exists
#
create table t1 (f1 integer primary key) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
alter table t1 add constraint c1 foreign key (f1) references t11(f1);
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
drop table t1;
#
# Foreign key on temporal tables
#
create temporary table t1(a int not null primary key, b int, key(b)) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
alter table t1 add foreign key(b) references t1(a);
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
drop table t1;
#
# Column numbers do not match
#
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
alter table t1 add foreign key(a,b) references t1(a);
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
drop table t1;
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
alter table t1 add foreign key(a) references t1(a,b);
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
drop table t1;
#
# ON UPDATE/DELETE SET NULL on NOT NULL column
#
create table t1 (f1 integer not null primary key) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
alter table t1 add constraint c1 foreign key (f1) references t1(f1) on update set null;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
create table t2(a int not null, foreign key(a) references t1(f1) on delete set null) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
drop table t1;
#
# Incorrect types
#
create table t1 (id int not null primary key, f1 int, f2 int, key(f1)) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error 1005
create table t2(a char(20), key(a), foreign key(a) references t1(f1)) engine=innodb;
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
show warnings;
drop table t1;
Supports Markdown
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