Merge 5.5 -> mwl248

This commit is contained in:
Igor Babaev 2013-01-08 15:04:14 -08:00
commit 7d9df8075e
50 changed files with 2340 additions and 1496 deletions

View File

@ -1914,7 +1914,9 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
const char *str_create)
{
uint i;
#ifndef DBUG_OFF
my_bool body_found= 0;
#endif
char *create_stmt_ptr= NULL;
ulong create_stmt_len= 0;
MYSQL_FIELD *field;
@ -1932,7 +1934,9 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
{
create_stmt_ptr= (*row)[i];
create_stmt_len= lengths[i];
#ifndef DBUG_OFF
body_found= 1;
#endif
}
else
{

View File

@ -18,8 +18,8 @@ export DEB_BUILD_OPTIONS="nocheck"
# Find major.minor version.
#
source ./VERSION
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}"
RELEASE_EXTRA=${MYSQL_VERSION_EXTRA}
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}"
RELEASE_EXTRA=""
RELEASE_NAME=mariadb
PATCHLEVEL=""

View File

@ -51,9 +51,6 @@ word32 PBKDF2_HMAC<T>::DeriveKey(byte* derived, word32 dLen, const byte* pwd,
if (dLen > MaxDerivedKeyLength())
return 0;
if (iterations < 0)
return 0;
ByteBlock buffer(T::DIGEST_SIZE);
HMAC<T> hmac;

View File

@ -2403,3 +2403,30 @@ a b
1 1
drop table t1;
#
# Checking that CREATE IF NOT EXISTS is not blocked by running SELECT
#
create table t1 (a int, b int) engine=myisam;
create table t2 (a int, b int) engine=myisam;
insert into t1 values (1,1);
lock tables t1 read;
set @@lock_wait_timeout=5;
create table if not exists t1 (a int, b int);
Warnings:
Note 1050 Table 't1' already exists
create table if not exists t1 (a int, b int) select 2,2;
Warnings:
Note 1050 Table 't1' already exists
create table if not exists t1 like t2;
Warnings:
Note 1050 Table 't1' already exists
create table t1 (a int, b int);
ERROR 42S01: Table 't1' already exists
create table t1 (a int, b int) select 2,2;
ERROR 42S01: Table 't1' already exists
create table t1 like t2;
ERROR 42S01: Table 't1' already exists
select * from t1;
a b
1 1
unlock tables;
drop table t1,t2;

View File

@ -1940,6 +1940,26 @@ event_object_table trigger_name
# Switching to connection 'default'.
#
#
# MDEV-3818: Query against view over IS tables worse than equivalent query without view
#
create view v1 as select table_schema, table_name, column_name from information_schema.columns;
explain extended
select column_name from v1
where (table_schema = "osm") and (table_name = "test");
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE columns ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL NULL Using where; Open_frm_only; Scanned 0 databases
Warnings:
Note 1003 select `information_schema`.`columns`.`COLUMN_NAME` AS `column_name` from `information_schema`.`columns` where ((`information_schema`.`columns`.`TABLE_SCHEMA` = 'osm') and (`information_schema`.`columns`.`TABLE_NAME` = 'test'))
explain extended
select information_schema.columns.column_name as column_name
from information_schema.columns
where (information_schema.columns.table_schema = 'osm') and (information_schema.columns.table_name = 'test');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE columns ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL NULL Using where; Open_frm_only; Scanned 0 databases
Warnings:
Note 1003 select `information_schema`.`columns`.`COLUMN_NAME` AS `column_name` from `information_schema`.`columns` where ((`information_schema`.`columns`.`TABLE_SCHEMA` = 'osm') and (`information_schema`.`columns`.`TABLE_NAME` = 'test'))
drop view v1;
#
# Clean-up.
drop database mysqltest;
#

View File

@ -2247,5 +2247,36 @@ MAX(a) bb
NULL NULL
drop table t1, t2;
set optimizer_switch=@subselect4_tmp;
#
# MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(9);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (8);
SELECT * FROM t1
WHERE (1, 1) IN (SELECT a, SUM(DISTINCT a) FROM t1, t2 GROUP BY a);
a
1
9
drop table t1, t2;
#
# MDEV-3902 Assertion `record_length == m_record_length' failed at Filesort_buffer::alloc_sort_buffer
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (pk INT PRIMARY KEY, b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,1),(2,7);
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
INSERT INTO t3 VALUES (8);
SELECT * FROM t1
WHERE (1, 5) IN (SELECT b, SUM(DISTINCT b) FROM t2, t3 GROUP BY b);
a
SELECT * FROM t2 AS alias1, t2 AS alias2
WHERE EXISTS ( SELECT 1 ) AND (alias2.pk = alias1.b )
ORDER BY alias1.b;
pk b pk b
1 1 1 1
drop table t1, t2, t3;
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;

View File

@ -11,6 +11,7 @@ Note 1265 Data truncated for column 'c1' at row 1
INSERT IGNORE INTO t1 (c1) VALUES(NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Warning 1062 Duplicate entry '2007-02-13' for key 'c1'
SELECT * FROM t1;
c1
2007-02-13
@ -20,6 +21,8 @@ CREATE TABLE t1(c1 YEAR NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(1999);
INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
Warnings:
Warning 1062 Duplicate entry '1999' for key 'c1'
SELECT * FROM t1;
c1
1999
@ -36,6 +39,7 @@ Note 1265 Data truncated for column 'c1' at row 1
INSERT IGNORE INTO t1 (c1) VALUES(NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Warning 1062 Duplicate entry '09:09:33' for key 'c1'
SELECT * FROM t1;
c1
09:09:33
@ -45,6 +49,8 @@ CREATE TABLE t1(c1 YEAR NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(1999);
INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
Warnings:
Warning 1062 Duplicate entry '1999' for key 'c1'
SELECT * FROM t1;
c1
1999
@ -55,6 +61,8 @@ SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
INSERT IGNORE INTO t1 (c1) VALUES(NOW());
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33' for key 'c1'
SELECT * FROM t1;
c1
2007-02-13 09:09:33
@ -64,6 +72,8 @@ CREATE TABLE t1(c1 YEAR NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(1999);
INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
Warnings:
Warning 1062 Duplicate entry '1999' for key 'c1'
SELECT * FROM t1;
c1
1999
@ -74,6 +84,8 @@ SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
INSERT IGNORE INTO t1 (c1) VALUES(NOW());
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33' for key 'c1'
SELECT * FROM t1;
c1
2007-02-13 09:09:33
@ -83,6 +95,8 @@ CREATE TABLE t1(c1 YEAR NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(1999);
INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
Warnings:
Warning 1062 Duplicate entry '1999' for key 'c1'
SELECT * FROM t1;
c1
1999

View File

@ -27,11 +27,13 @@ Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Warning 1062 Duplicate entry '2007-02-13-2007-02-13-2007-02-13' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Warning 1062 Duplicate entry '2007-02-13-2007-02-13-2007-02-14' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
2007-02-13 2007-02-13 2007-02-13
@ -45,7 +47,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
Warnings:
Warning 1062 Duplicate entry '1999-1999-1999' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
Warnings:
Warning 1062 Duplicate entry '1999-1999-2000' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
1999 1999 1999
@ -80,11 +86,13 @@ Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Warning 1062 Duplicate entry '09:09:33-09:09:33-09:09:33' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Warning 1062 Duplicate entry '09:09:33-09:09:33-10:10:34' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
09:09:33 09:09:33 09:09:33
@ -98,7 +106,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
Warnings:
Warning 1062 Duplicate entry '1999-1999-1999' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
Warnings:
Warning 1062 Duplicate entry '1999-1999-2000' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
1999 1999 1999
@ -113,7 +125,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW());
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33-2007-02-13 09:09:33-2007-02-13 09:09:33' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33-2007-02-13 09:09:33-2007-02-14 10:10:34' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
2007-02-13 09:09:33 2007-02-13 09:09:33 2007-02-13 09:09:33
@ -127,7 +143,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
Warnings:
Warning 1062 Duplicate entry '1999-1999-1999' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
Warnings:
Warning 1062 Duplicate entry '1999-1999-2000' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
1999 1999 1999
@ -142,7 +162,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW());
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33-2007-02-13 09:09:33-2007-02-13 09:09:33' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33-2007-02-13 09:09:33-2007-02-14 10:10:34' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
2007-02-13 09:09:33 2007-02-13 09:09:33 2007-02-13 09:09:33
@ -156,7 +180,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
Warnings:
Warning 1062 Duplicate entry '1999-1999-1999' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
Warnings:
Warning 1062 Duplicate entry '1999-1999-2000' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
1999 1999 1999

View File

@ -8,8 +8,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -29,8 +35,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -50,8 +62,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -71,8 +89,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -92,8 +116,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -113,8 +143,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -134,8 +170,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -155,8 +197,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -176,8 +224,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -197,8 +251,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -218,8 +278,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -239,8 +305,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -260,8 +332,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
@ -281,8 +359,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10

View File

@ -8,8 +8,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-def' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','def','def');
Warnings:
Warning 1062 Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc abc abc
@ -29,8 +35,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-def' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','def','def');
Warnings:
Warning 1062 Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc abc abc
@ -50,8 +62,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-def' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','def','def');
Warnings:
Warning 1062 Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc
@ -65,8 +83,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-def' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','def','def');
Warnings:
Warning 1062 Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc abc abc

View File

@ -3,6 +3,8 @@ CREATE TABLE t1(c1 TINYINT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -12,6 +14,8 @@ CREATE TABLE t1(c1 SMALLINT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -21,6 +25,8 @@ CREATE TABLE t1(c1 MEDIUMINT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -30,6 +36,8 @@ CREATE TABLE t1(c1 INT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -39,6 +47,8 @@ CREATE TABLE t1(c1 INTEGER NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -48,6 +58,8 @@ CREATE TABLE t1(c1 BIGINT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -57,6 +69,8 @@ CREATE TABLE t1(c1 DECIMAL NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -66,6 +80,8 @@ CREATE TABLE t1(c1 DEC NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -75,6 +91,8 @@ CREATE TABLE t1(c1 FIXED NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -84,6 +102,8 @@ CREATE TABLE t1(c1 NUMERIC NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -93,6 +113,8 @@ CREATE TABLE t1(c1 DOUBLE NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -102,6 +124,8 @@ CREATE TABLE t1(c1 REAL NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -111,6 +135,8 @@ CREATE TABLE t1(c1 DOUBLE PRECISION NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
@ -120,6 +146,8 @@ CREATE TABLE t1(c1 FLOAT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10

View File

@ -3,6 +3,8 @@ CREATE TABLE t1(c1 TINYINT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -12,6 +14,8 @@ CREATE TABLE t1(c1 SMALLINT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -21,6 +25,8 @@ CREATE TABLE t1(c1 MEDIUMINT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -30,6 +36,8 @@ CREATE TABLE t1(c1 INT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -39,6 +47,8 @@ CREATE TABLE t1(c1 INTEGER NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -48,6 +58,8 @@ CREATE TABLE t1(c1 BIGINT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -57,6 +69,8 @@ CREATE TABLE t1(c1 DECIMAL NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -66,6 +80,8 @@ CREATE TABLE t1(c1 DEC NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -75,6 +91,8 @@ CREATE TABLE t1(c1 FIXED NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -84,6 +102,8 @@ CREATE TABLE t1(c1 NUMERIC NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -93,6 +113,8 @@ CREATE TABLE t1(c1 DOUBLE NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -102,6 +124,8 @@ CREATE TABLE t1(c1 REAL NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -111,6 +135,8 @@ CREATE TABLE t1(c1 DOUBLE PRECISION NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
@ -120,6 +146,8 @@ CREATE TABLE t1(c1 FLOAT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10

View File

@ -2,6 +2,8 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
TRUNCATE TABLE t1;
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc

View File

@ -1,6 +1,8 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_unique_error1.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc
@ -10,6 +12,8 @@ c1 c2
DROP TABLE t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_unique_error1.inc' IGNORE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc

View File

@ -4,6 +4,9 @@ INSERT INTO t1 VALUES(3,'a');
ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES(3,'a');
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc

View File

@ -2,6 +2,8 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
INSERT INTO t1 VALUES(3,'a');
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_unique_error2.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc
@ -12,6 +14,8 @@ DROP TABLE t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
INSERT INTO t1 VALUES(3,'a');
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_unique_error2.inc' IGNORE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc

View File

@ -12,6 +12,10 @@ Tables_in_test
t1
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
TRUNCATE TABLE t1;
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '0' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
0 def

View File

@ -1,6 +1,10 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_unique_error1.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '0' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
0 def
@ -8,6 +12,10 @@ c1 c2
DROP TABLE t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_unique_error1.inc' IGNORE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '0' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
0 def

View File

@ -2399,8 +2399,9 @@ INSERT INTO t3 VALUES(0,-128,1,2,3,4,5),(255,127,6,7,8,9,10);
INSERT INTO t4 VALUES(-128,0,1,2,3,4,5,5),(127,255,6,7,8,9,10,10);
INSERT INTO t5 VALUES(0,-128,1,2,3,4,5,5),(255,127,6,7,8,9,10,10);
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
ERROR 22003: Out of range value for column 'c1' at row 1
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
ERROR 22003: Out of range value for column 'c1' at row 1
SELECT * FROM t4;
c1 c2 c3 c4 c5 c6 c7 c8
-101 102 103 104 105 106 107 108
@ -3760,20 +3761,12 @@ c1 c2 c3 c4 c5 c6 c7
0 124 27 28 29 30 31
SELECT * FROM t2 WHERE c1 = 256 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 256 ORDER BY c1,c6 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 256 ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 256 ORDER BY c1,c6 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 <> 256 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
@ -5316,20 +5309,12 @@ c1 c2 c3 c4 c5 c6 c7
0 -128 26 27 28 29 30
SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 <> 128 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
0 -128 1 2 3 4 5
@ -8006,8 +7991,9 @@ INSERT INTO t3 VALUES(0,-32768,1,2,3,4,5),(255,-128,6,7,8,9,10),(65535,32767,11,
INSERT INTO t4 VALUES(-32768,0,1,2,3,4,5,5),(-128,255,6,7,8,9,10,10),(32767,65535,11,12,13,14,15,15);
INSERT INTO t5 VALUES(0,-32768,1,2,3,4,5,5),(255,-128,6,7,8,9,10,10),(65535,32767,11,12,13,14,15,15);
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
ERROR 23000: Duplicate entry '32767' for key 'PRIMARY'
ERROR 22003: Out of range value for column 'c1' at row 1
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
ERROR 22003: Out of range value for column 'c1' at row 1
SELECT * FROM t4;
c1 c2 c3 c4 c5 c6 c7 c8
-101 102 103 104 105 106 107 108
@ -9410,20 +9396,12 @@ c1 c2 c3 c4 c5 c6 c7
0 124 27 28 29 30 31
SELECT * FROM t2 WHERE c1 = 65536 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 65536 ORDER BY c1,c6 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 65536 ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 65536 ORDER BY c1,c6 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 <> 65536 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
@ -11018,20 +10996,12 @@ c1 c2 c3 c4 c5 c6 c7
0 -32768 26 27 28 29 30
SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 <> 32768 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
0 -32768 1 2 3 4 5
@ -13718,8 +13688,9 @@ INSERT INTO t3 VALUES(0,-8388608,1,2,3,4,5),(255,-32768,6,7,8,9,10),(65535,-128,
INSERT INTO t4 VALUES(-8388608,0,1,2,3,4,5,5),(-32768,255,6,7,8,9,10,10),(-128,65535,11,12,13,14,15,15),(8388607,16777215,16,17,18,19,20,20);
INSERT INTO t5 VALUES(0,-8388608,1,2,3,4,5,5),(255,-32768,6,7,8,9,10,10),(65535,-128,11,12,13,14,15,15),(16777215,8388607,16,17,18,19,20,20);
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
ERROR 23000: Duplicate entry '8388607' for key 'PRIMARY'
ERROR 22003: Out of range value for column 'c1' at row 1
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
ERROR 22003: Out of range value for column 'c1' at row 1
SELECT * FROM t4;
c1 c2 c3 c4 c5 c6 c7 c8
-101 102 103 104 105 106 107 108
@ -15165,20 +15136,12 @@ c1 c2 c3 c4 c5 c6 c7
0 124 27 28 29 30 31
SELECT * FROM t2 WHERE c1 = 16777216 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 16777216 ORDER BY c1,c6 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 16777216 ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 16777216 ORDER BY c1,c6 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 <> 16777216 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
@ -16825,20 +16788,12 @@ c1 c2 c3 c4 c5 c6 c7
0 -8388608 26 27 28 29 30
SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 <> 8388608 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
0 -8388608 1 2 3 4 5
@ -19535,8 +19490,9 @@ INSERT INTO t3 VALUES(0,-2147483648,1,2,3,4,5),(255,-8388608,6,7,8,9,10),(65535,
INSERT INTO t4 VALUES(-2147483648,0,1,2,3,4,5,5),(-8388608,255,6,7,8,9,10,10),(-32768,65535,11,12,13,14,15,15),(-128,16777215,16,17,18,19,20,20),(2147483647,4294967295,21,22,23,24,25,25);
INSERT INTO t5 VALUES(0,-2147483648,1,2,3,4,5,5),(255,-8388608,6,7,8,9,10,10),(65535,-32768,11,12,13,14,15,15),(16777215,-128,16,17,18,19,20,20),(4294967295,2147483647,21,22,23,24,25,25);
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY'
ERROR 22003: Out of range value for column 'c1' at row 1
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
ERROR 22003: Out of range value for column 'c1' at row 1
SELECT * FROM t4;
c1 c2 c3 c4 c5 c6 c7 c8
-101 102 103 104 105 106 107 108
@ -21025,20 +20981,12 @@ c1 c2 c3 c4 c5 c6 c7
0 124 27 28 29 30 31
SELECT * FROM t2 WHERE c1 = 4294967296 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 4294967296 ORDER BY c1,c6 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 4294967296 ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 4294967296 ORDER BY c1,c6 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 <> 4294967296 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
@ -22737,20 +22685,12 @@ c1 c2 c3 c4 c5 c6 c7
0 -2147483648 26 27 28 29 30
SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 <> 2147483648 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
0 -2147483648 1 2 3 4 5
@ -25457,8 +25397,9 @@ INSERT INTO t3 VALUES(0,-2147483648,1,2,3,4,5),(255,-8388608,6,7,8,9,10),(65535,
INSERT INTO t4 VALUES(-2147483648,0,1,2,3,4,5,5),(-8388608,255,6,7,8,9,10,10),(-32768,65535,11,12,13,14,15,15),(-128,16777215,16,17,18,19,20,20),(2147483647,4294967295,21,22,23,24,25,25);
INSERT INTO t5 VALUES(0,-2147483648,1,2,3,4,5,5),(255,-8388608,6,7,8,9,10,10),(65535,-32768,11,12,13,14,15,15),(16777215,-128,16,17,18,19,20,20),(4294967295,2147483647,21,22,23,24,25,25);
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY'
ERROR 22003: Out of range value for column 'c1' at row 1
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
ERROR 22003: Out of range value for column 'c1' at row 1
SELECT * FROM t4;
c1 c2 c3 c4 c5 c6 c7 c8
-101 102 103 104 105 106 107 108
@ -26947,20 +26888,12 @@ c1 c2 c3 c4 c5 c6 c7
0 124 27 28 29 30 31
SELECT * FROM t2 WHERE c1 = 4294967296 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 4294967296 ORDER BY c1,c6 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 4294967296 ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 = 4294967296 ORDER BY c1,c6 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t2 WHERE c1 <> 4294967296 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
@ -28659,20 +28592,12 @@ c1 c2 c3 c4 c5 c6 c7
0 -2147483648 26 27 28 29 30
SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 <> 2147483648 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
0 -2147483648 1 2 3 4 5
@ -31379,7 +31304,7 @@ INSERT INTO t3 VALUES(0,-9223372036854775808,1,2,3,4,5),(255,-2147483648,6,7,8,9
INSERT INTO t4 VALUES(-9223372036854775808,0,1,2,3,4,5,5),(-2147483648,255,6,7,8,9,10,10),(-8388608,65535,11,12,13,14,15,15),(-32768,16777215,16,17,18,19,20,20),(-128,4294967295,21,22,23,24,25,25),(9223372036854775807,18446744073709551615,26,27,28,29,30,30);
INSERT INTO t5 VALUES(0,-9223372036854775808,1,2,3,4,5,5),(255,-2147483648,6,7,8,9,10,10),(65535,-8388608,11,12,13,14,15,15),(16777215,-32768,16,17,18,19,20,20),(4294967295,-128,21,22,23,24,25,25),(18446744073709551615,9223372036854775807,26,27,28,29,30,30);
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
ERROR 23000: Duplicate entry '9223372036854775807' for key 'PRIMARY'
ERROR 22003: Out of range value for column 'c1' at row 1
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
ERROR HY000: Failed to read auto-increment value from storage engine
SELECT * FROM t4;
@ -34577,20 +34502,12 @@ c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 DESC;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t3 WHERE c2 <> 9223372036854775808 ORDER BY c2,c7;
c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 1 2 3 4 5

View File

@ -5072,8 +5072,12 @@ INSERT INTO t3(c1,c2) VALUES('34 9:23','34 9:23') /* throws error as row exists
ERROR 23000: Duplicate entry '825:23:00-825:23:00' for key 'idx'
INSERT IGNORE INTO t1(c1,c2) VALUES('10:22:33','10:22:34') /* doesn't throw error */;
INSERT IGNORE INTO t2(c1,c2) VALUES('12:34:56.78','12:34:56.78') /*doesn't throw error */;
Warnings:
Warning 1062 Duplicate entry '12:34:56-12:34:56' for key 'PRIMARY'
INSERT IGNORE INTO t1(c1,c2) VALUES('10:22:34','34 9:23') /*doesn't throw error */;
INSERT IGNORE INTO t3(c1,c2) VALUES('34 9:23','34 9:23') /*doesn't throw error */;
Warnings:
Warning 1062 Duplicate entry '825:23:00-825:23:00' for key 'idx'
SELECT * FROM t1 WHERE c1='10:23:33' /* no rows */;
c1 c2 c3
INSERT INTO t1(c1) VALUES('10:22:33') ON DUPLICATE KEY UPDATE c1='10:23:33';

View File

@ -3124,9 +3124,17 @@ ERROR 23000: Duplicate entry '2069' for key 'c2'
INSERT INTO t3(c1,c2) VALUES(00,00);
ERROR 23000: Duplicate entry '0000-0000' for key 'idx'
INSERT IGNORE INTO t1(c1,c2) VALUES(01,'99');
Warnings:
Warning 1062 Duplicate entry '2001' for key 'PRIMARY'
INSERT IGNORE INTO t2(c1,c2) VALUES('1999','1999');
Warnings:
Warning 1062 Duplicate entry '1999-1999' for key 'PRIMARY'
INSERT IGNORE INTO t1(c1,c2) VALUES('2098','69');
Warnings:
Warning 1062 Duplicate entry '2069' for key 'c2'
INSERT IGNORE INTO t3(c1,c2) VALUES(00,00);
Warnings:
Warning 1062 Duplicate entry '0000-0000' for key 'idx'
SELECT * FROM t1 WHERE c1='01' /* Returns 1 row */;
c1 c2 c3 c4
2001 2001 1998-12-28 1998-12-28 11:30:45
@ -6081,9 +6089,17 @@ ERROR 23000: Duplicate entry '69' for key 'c2'
INSERT INTO t3(c1,c2) VALUES(00,00);
ERROR 23000: Duplicate entry '00-00' for key 'idx'
INSERT IGNORE INTO t1(c1,c2) VALUES(01,'99');
Warnings:
Warning 1062 Duplicate entry '01' for key 'PRIMARY'
INSERT IGNORE INTO t2(c1,c2) VALUES('1999','1999');
Warnings:
Warning 1062 Duplicate entry '99-99' for key 'PRIMARY'
INSERT IGNORE INTO t1(c1,c2) VALUES('2098','69');
Warnings:
Warning 1062 Duplicate entry '69' for key 'c2'
INSERT IGNORE INTO t3(c1,c2) VALUES(00,00);
Warnings:
Warning 1062 Duplicate entry '00-00' for key 'idx'
SELECT * FROM t1 WHERE c1='01' /* Returns 1 row */;
c1 c2 c3 c4
01 01 1998-12-28 1998-12-28 11:30:45

File diff suppressed because it is too large Load Diff

View File

@ -56,8 +56,6 @@ Warning 1264 Out of range value for column 'c2' at row 3
SELECT COUNT(*) FROM t1 WHERE c1=4294967296 AND c2=2147483648 /* no rows */;
COUNT(*)
0
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t1 WHERE c1=4294967295 AND c2=2147483647;
c1 c2 c3
4294967295 2147483647 10
@ -1152,8 +1150,6 @@ Warning 1264 Out of range value for column 'c2' at row 3
SELECT COUNT(*) FROM t1 WHERE c1=256 AND c2=128 /* no rows */;
COUNT(*)
0
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t1 WHERE c1=255 AND c2=127;
c1 c2 c3
255 127 10
@ -1926,8 +1922,6 @@ Warning 1264 Out of range value for column 'c2' at row 3
SELECT COUNT(*) FROM t1 WHERE c1=65536 AND c2=32768 /* no rows */;
COUNT(*)
0
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t1 WHERE c1=65535 AND c2=32767;
c1 c2 c3
65535 32767 10
@ -2675,8 +2669,6 @@ Warning 1264 Out of range value for column 'c2' at row 3
SELECT COUNT(*) FROM t1 WHERE c1=16777216 AND c2=8388608 /* no rows */;
COUNT(*)
0
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t1 WHERE c1=16777215 AND c2=8388607;
c1 c2 c3
16777215 8388607 10
@ -3424,8 +3416,6 @@ Warning 1264 Out of range value for column 'c2' at row 3
SELECT COUNT(*) FROM t1 WHERE c1=18446744073709551616 AND c2=9223372036854775808 /* no rows */;
COUNT(*)
0
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
SELECT * FROM t1 WHERE c1=18446744073709551615 AND c2=9223372036854775807;
c1 c2 c3
18446744073709551615 9223372036854775807 10

View File

@ -761,11 +761,10 @@ INSERT INTO t2 VALUES(0,-128,1,2,3,4,5),(255,127,6,7,8,9,10);
INSERT INTO t3 VALUES(0,-128,1,2,3,4,5),(255,127,6,7,8,9,10);
INSERT INTO t4 VALUES(-128,0,1,2,3,4,5,5),(127,255,6,7,8,9,10,10);
INSERT INTO t5 VALUES(0,-128,1,2,3,4,5,5),(255,127,6,7,8,9,10,10);
--error ER_DUP_ENTRY
--error 167
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
--disable_warnings
--error 167
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
--enable_warnings
--sorted_result
SELECT * FROM t4;
@ -2120,11 +2119,10 @@ INSERT INTO t2 VALUES(0,-32768,1,2,3,4,5),(255,-128,6,7,8,9,10),(65535,32767,11,
INSERT INTO t3 VALUES(0,-32768,1,2,3,4,5),(255,-128,6,7,8,9,10),(65535,32767,11,12,13,14,15);
INSERT INTO t4 VALUES(-32768,0,1,2,3,4,5,5),(-128,255,6,7,8,9,10,10),(32767,65535,11,12,13,14,15,15);
INSERT INTO t5 VALUES(0,-32768,1,2,3,4,5,5),(255,-128,6,7,8,9,10,10),(65535,32767,11,12,13,14,15,15);
--error ER_DUP_ENTRY
--error 167
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
--disable_warnings
--error 167
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
--enable_warnings
--sorted_result
SELECT * FROM t4;
@ -3479,11 +3477,10 @@ INSERT INTO t2 VALUES(0,-8388608,1,2,3,4,5),(255,-32768,6,7,8,9,10),(65535,-128,
INSERT INTO t3 VALUES(0,-8388608,1,2,3,4,5),(255,-32768,6,7,8,9,10),(65535,-128,11,12,13,14,15),(16777215,8388607,16,17,18,19,20);
INSERT INTO t4 VALUES(-8388608,0,1,2,3,4,5,5),(-32768,255,6,7,8,9,10,10),(-128,65535,11,12,13,14,15,15),(8388607,16777215,16,17,18,19,20,20);
INSERT INTO t5 VALUES(0,-8388608,1,2,3,4,5,5),(255,-32768,6,7,8,9,10,10),(65535,-128,11,12,13,14,15,15),(16777215,8388607,16,17,18,19,20,20);
--error ER_DUP_ENTRY
--error 167
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
--disable_warnings
--error 167
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
--enable_warnings
--sorted_result
SELECT * FROM t4;
@ -4838,11 +4835,10 @@ INSERT INTO t2 VALUES(0,-2147483648,1,2,3,4,5),(255,-8388608,6,7,8,9,10),(65535,
INSERT INTO t3 VALUES(0,-2147483648,1,2,3,4,5),(255,-8388608,6,7,8,9,10),(65535,-32768,11,12,13,14,15),(16777215,-128,16,17,18,19,20),(4294967295,2147483647,21,22,23,24,25);
INSERT INTO t4 VALUES(-2147483648,0,1,2,3,4,5,5),(-8388608,255,6,7,8,9,10,10),(-32768,65535,11,12,13,14,15,15),(-128,16777215,16,17,18,19,20,20),(2147483647,4294967295,21,22,23,24,25,25);
INSERT INTO t5 VALUES(0,-2147483648,1,2,3,4,5,5),(255,-8388608,6,7,8,9,10,10),(65535,-32768,11,12,13,14,15,15),(16777215,-128,16,17,18,19,20,20),(4294967295,2147483647,21,22,23,24,25,25);
--error ER_DUP_ENTRY
--error 167
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
--disable_warnings
--error 167
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
--enable_warnings
--sorted_result
SELECT * FROM t4;
@ -6197,11 +6193,10 @@ INSERT INTO t2 VALUES(0,-2147483648,1,2,3,4,5),(255,-8388608,6,7,8,9,10),(65535,
INSERT INTO t3 VALUES(0,-2147483648,1,2,3,4,5),(255,-8388608,6,7,8,9,10),(65535,-32768,11,12,13,14,15),(16777215,-128,16,17,18,19,20),(4294967295,2147483647,21,22,23,24,25);
INSERT INTO t4 VALUES(-2147483648,0,1,2,3,4,5,5),(-8388608,255,6,7,8,9,10,10),(-32768,65535,11,12,13,14,15,15),(-128,16777215,16,17,18,19,20,20),(2147483647,4294967295,21,22,23,24,25,25);
INSERT INTO t5 VALUES(0,-2147483648,1,2,3,4,5,5),(255,-8388608,6,7,8,9,10,10),(65535,-32768,11,12,13,14,15,15),(16777215,-128,16,17,18,19,20,20),(4294967295,2147483647,21,22,23,24,25,25);
--error ER_DUP_ENTRY
--error 167
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
--disable_warnings
--error 167
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
--enable_warnings
--sorted_result
SELECT * FROM t4;
@ -7555,7 +7550,7 @@ INSERT INTO t2 VALUES(0,-9223372036854775808,1,2,3,4,5),(255,-2147483648,6,7,8,9
INSERT INTO t3 VALUES(0,-9223372036854775808,1,2,3,4,5),(255,-2147483648,6,7,8,9,10),(65535,-8388608,11,12,13,14,15),(16777215,-32768,16,17,18,19,20),(4294967295,-128,21,22,23,24,25),(18446744073709551615,9223372036854775807,26,27,28,29,30);
INSERT INTO t4 VALUES(-9223372036854775808,0,1,2,3,4,5,5),(-2147483648,255,6,7,8,9,10,10),(-8388608,65535,11,12,13,14,15,15),(-32768,16777215,16,17,18,19,20,20),(-128,4294967295,21,22,23,24,25,25),(9223372036854775807,18446744073709551615,26,27,28,29,30,30);
INSERT INTO t5 VALUES(0,-9223372036854775808,1,2,3,4,5,5),(255,-2147483648,6,7,8,9,10,10),(65535,-8388608,11,12,13,14,15,15),(16777215,-32768,16,17,18,19,20,20),(4294967295,-128,21,22,23,24,25,25),(18446744073709551615,9223372036854775807,26,27,28,29,30,30);
--error ER_DUP_ENTRY
--error 167
INSERT INTO t4(c2,c3) VALUES(31,32) /* tries to increment out of range */;
--error ER_AUTOINC_READ_FAILED
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;

View File

@ -44,12 +44,10 @@ SET auto_increment_increment = 500;
SET auto_increment_offset = 300;
CREATE TABLE t1 (a TINYINT <CUSTOM_COL_OPTIONS> AUTO_INCREMENT, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a) VALUES (NULL);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
ERROR 22003: Out of range value for column 'a' at row 1
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
127
850
SELECT * FROM t1;
a
127
DROP TABLE t1;

View File

@ -739,6 +739,8 @@ y YEAR <CUSTOM_COL_OPTIONS> NOT NULL,
y4 YEAR(4) <CUSTOM_COL_OPTIONS> NOT NULL,
y2 YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
d date # # #
@ -913,6 +915,8 @@ COUNT(c) COUNT(c2)
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
c year(2) NO NULL
@ -922,6 +926,9 @@ DROP TABLE t1;
CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL,
c2 YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '12'
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
c year(2) NO NULL

View File

@ -723,6 +723,8 @@ y YEAR <CUSTOM_COL_OPTIONS> NULL,
y4 YEAR(4) <CUSTOM_COL_OPTIONS> NULL,
y2 YEAR(2) <CUSTOM_COL_OPTIONS> NULL
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
d date # # #
@ -884,6 +886,8 @@ COUNT(c2) COUNT(c1) COUNT(c) COUNT(*)
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
c year(2) YES NULL
@ -896,6 +900,10 @@ CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NULL,
c1 YEAR(2) <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL,
c2 YEAR(2) <CUSTOM_COL_OPTIONS> NULL DEFAULT '12'
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
c year(2) YES NULL

View File

@ -47,6 +47,8 @@ a b
5 e
6 f
INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
Warnings:
Warning 1062 Duplicate entry '1' for key 'a'
INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10;
SELECT * FROM t1;
a b
@ -85,6 +87,8 @@ a b
5 e
6 f
INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
Warnings:
Warning 1062 Duplicate entry '1-a' for key 'a'
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a);
SELECT * FROM t1;
a b
@ -131,6 +135,8 @@ a b
5 e
6 f
INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b);
SELECT * FROM t1;
a b

View File

@ -7,6 +7,8 @@ y YEAR <CUSTOM_COL_OPTIONS>,
y4 YEAR(4) <CUSTOM_COL_OPTIONS>,
y2 YEAR(2) <CUSTOM_COL_OPTIONS>
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
d date # # #

View File

@ -1996,4 +1996,28 @@ create table if not exists t1 (a int unique, b int)
ignore select 1 as a, 1 as b union select 1 as a, 2 as b;
select * from t1;
drop table t1;
--echo #
--echo # Checking that CREATE IF NOT EXISTS is not blocked by running SELECT
--echo #
create table t1 (a int, b int) engine=myisam;
create table t2 (a int, b int) engine=myisam;
insert into t1 values (1,1);
lock tables t1 read;
connect (user1,localhost,root,,test);
set @@lock_wait_timeout=5;
create table if not exists t1 (a int, b int);
create table if not exists t1 (a int, b int) select 2,2;
create table if not exists t1 like t2;
--error ER_TABLE_EXISTS_ERROR
create table t1 (a int, b int);
--error ER_TABLE_EXISTS_ERROR
create table t1 (a int, b int) select 2,2;
--error ER_TABLE_EXISTS_ERROR
create table t1 like t2;
disconnect user1;
connection default;
select * from t1;
unlock tables;
drop table t1,t2;

View File

@ -1789,6 +1789,24 @@ disconnect con12828477_1;
disconnect con12828477_2;
disconnect con12828477_3;
--echo #
--echo # MDEV-3818: Query against view over IS tables worse than equivalent query without view
--echo #
create view v1 as select table_schema, table_name, column_name from information_schema.columns;
explain extended
select column_name from v1
where (table_schema = "osm") and (table_name = "test");
explain extended
select information_schema.columns.column_name as column_name
from information_schema.columns
where (information_schema.columns.table_schema = 'osm') and (information_schema.columns.table_name = 'test');
drop view v1;
--echo #
--echo # Clean-up.
drop database mysqltest;

View File

@ -1777,5 +1777,42 @@ drop table t1, t2;
set optimizer_switch=@subselect4_tmp;
--echo #
--echo # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
--echo #
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(9);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (8);
SELECT * FROM t1
WHERE (1, 1) IN (SELECT a, SUM(DISTINCT a) FROM t1, t2 GROUP BY a);
drop table t1, t2;
--echo #
--echo # MDEV-3902 Assertion `record_length == m_record_length' failed at Filesort_buffer::alloc_sort_buffer
--echo #
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (pk INT PRIMARY KEY, b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,1),(2,7);
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
INSERT INTO t3 VALUES (8);
SELECT * FROM t1
WHERE (1, 5) IN (SELECT b, SUM(DISTINCT b) FROM t2, t3 GROUP BY b);
SELECT * FROM t2 AS alias1, t2 AS alias2
WHERE EXISTS ( SELECT 1 ) AND (alias2.pk = alias1.b )
ORDER BY alias1.b;
drop table t1, t2, t3;
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;

View File

@ -118,10 +118,10 @@ Usage: $script [host [user [db]]] OPTIONS
--rollback undo the last changes to the grant-tables.
Note:
+ At least the user and the db must be given (even with wildcards)
+ If no host is given, `localhost' is assumed
+ Wilcards (*,?,%,_) are allowed for host, user and db, but be sure
to escape them from your shell!! (ie type \\* or '*')
At least the user and the db must be given (even with wildcards)
If no host is given, `localhost' is assumed
Wilcards (*,?,%,_) are allowed for host, user and db, but be sure
to escape them from your shell!! (ie type \\* or '*')
_OPTIONS
$RELEASE = <<'_RELEASE';

View File

@ -2442,21 +2442,6 @@ void dec_connection_count(THD *thd)
}
/*
Delete the THD object and decrease number of threads
SYNOPSIS
delete_thd()
thd Thread handler
*/
void delete_thd(THD *thd)
{
thread_count--;
delete thd;
}
/*
Unlink thd from global list of available connections and free thd
@ -2475,14 +2460,23 @@ void unlink_thd(THD *thd)
thd_cleanup(thd);
dec_connection_count(thd);
mysql_mutex_lock(&LOCK_status);
add_to_status(&global_status_var, &thd->status_var);
mysql_mutex_unlock(&LOCK_status);
mysql_mutex_lock(&LOCK_thread_count);
thread_count--;
thd->unlink();
/*
Used by binlog_reset_master. It would be cleaner to use
DEBUG_SYNC here, but that's not possible because the THD's debug
sync feature has been shut down at this point.
*/
DBUG_EXECUTE_IF("sleep_after_lock_thread_count_before_delete_thd", sleep(5););
delete_thd(thd);
mysql_mutex_unlock(&LOCK_thread_count);
delete thd;
DBUG_VOID_RETURN;
}
@ -2591,10 +2585,13 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache)
/* Mark that current_thd is not valid anymore */
my_pthread_setspecific_ptr(THR_THD, 0);
if (put_in_cache)
{
mysql_mutex_lock(&LOCK_thread_count);
put_in_cache= cache_thread();
mysql_mutex_unlock(&LOCK_thread_count);
if (put_in_cache)
DBUG_RETURN(0); // Thread is reused
mysql_mutex_unlock(&LOCK_thread_count);
if (put_in_cache)
DBUG_RETURN(0); // Thread is reused
}
/* It's safe to broadcast outside a lock (COND... is not deleted here) */
DBUG_PRINT("signal", ("Broadcasting COND_thread_count"));

View File

@ -35,7 +35,6 @@
static bool no_threads_end(THD *thd, bool put_in_cache)
{
unlink_thd(thd);
mysql_mutex_unlock(&LOCK_thread_count);
return 1; // Abort handle_one_connection
}

View File

@ -2401,10 +2401,11 @@ void drop_open_table(THD *thd, TABLE *table, const char *db_name,
Check that table exists in table definition cache, on disk
or in some storage engine.
@param thd Thread context
@param table Table list element
@param[out] exists Out parameter which is set to TRUE if table
exists and to FALSE otherwise.
@param thd Thread context
@param table Table list element
@param fast_check Check only if share or .frm file exists
@param[out] exists Out parameter which is set to TRUE if table
exists and to FALSE otherwise.
@note This function acquires LOCK_open internally.
@ -2416,7 +2417,8 @@ void drop_open_table(THD *thd, TABLE *table, const char *db_name,
@retval FALSE No error. 'exists' out parameter set accordingly.
*/
bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists)
bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool fast_check,
bool *exists)
{
char path[FN_REFLEN + 1];
TABLE_SHARE *share;
@ -2424,7 +2426,8 @@ bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists)
*exists= TRUE;
DBUG_ASSERT(thd->mdl_context.
DBUG_ASSERT(fast_check ||
thd->mdl_context.
is_lock_owner(MDL_key::TABLE, table->db,
table->table_name, MDL_SHARED));
@ -2441,6 +2444,12 @@ bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists)
if (!access(path, F_OK))
goto end;
if (fast_check)
{
*exists= FALSE;
goto end;
}
/* .FRM file doesn't exist. Check if some engine can provide it. */
if (ha_check_if_table_exists(thd, table->db, table->table_name, exists))
{
@ -2990,7 +2999,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
{
bool exists;
if (check_if_table_exists(thd, table_list, &exists))
if (check_if_table_exists(thd, table_list, 0, &exists))
DBUG_RETURN(TRUE);
if (!exists)
@ -4698,7 +4707,18 @@ extern "C" uchar *schema_set_get_key(const uchar *record, size_t *length,
open, see open_table() description for details.
@retval FALSE Success.
@retval TRUE Failure (e.g. connection was killed)
@retval TRUE Failure (e.g. connection was killed) or table existed
for a CREATE TABLE.
@notes
In case of CREATE TABLE we avoid a wait for tables that are in use
by first trying to do a meta data lock with timeout == 0. If we get a
timeout we will check if table exists (it should) and retry with
normal timeout if it didn't exists.
Note that for CREATE TABLE IF EXISTS we only generate a warning
but still return TRUE (to abort the calling open_table() function).
On must check THD->is_error() if one wants to distinguish between warning
and error.
*/
bool
@ -4710,6 +4730,10 @@ lock_table_names(THD *thd,
TABLE_LIST *table;
MDL_request global_request;
Hash_set<TABLE_LIST, schema_set_get_key> schema_set;
ulong org_lock_wait_timeout= lock_wait_timeout;
/* Check if we are using CREATE TABLE ... IF NOT EXISTS */
bool create_table;
Dummy_error_handler error_handler;
DBUG_ENTER("lock_table_names");
DBUG_ASSERT(!thd->locked_tables_mode);
@ -4731,8 +4755,14 @@ lock_table_names(THD *thd,
}
}
if (! (flags & MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK) &&
! mdl_requests.is_empty())
if (mdl_requests.is_empty())
DBUG_RETURN(FALSE);
/* Check if CREATE TABLE IF NOT EXISTS was used */
create_table= (tables_start && tables_start->open_strategy ==
TABLE_LIST::OPEN_IF_EXISTS);
if (!(flags & MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK))
{
/*
Scoped locks: Take intention exclusive locks on all involved
@ -4760,12 +4790,58 @@ lock_table_names(THD *thd,
global_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE,
MDL_STATEMENT);
mdl_requests.push_front(&global_request);
if (create_table)
lock_wait_timeout= 0; // Don't wait for timeout
}
if (thd->mdl_context.acquire_locks(&mdl_requests, lock_wait_timeout))
DBUG_RETURN(TRUE);
for (;;)
{
bool exists= TRUE;
bool res;
DBUG_RETURN(FALSE);
if (create_table)
thd->push_internal_handler(&error_handler); // Avoid warnings & errors
res= thd->mdl_context.acquire_locks(&mdl_requests, lock_wait_timeout);
if (create_table)
thd->pop_internal_handler();
if (!res)
DBUG_RETURN(FALSE); // Got locks
if (!create_table)
DBUG_RETURN(TRUE); // Return original error
/*
We come here in the case of lock timeout when executing
CREATE TABLE IF NOT EXISTS.
Verify that table really exists (it should as we got a lock conflict)
*/
if (check_if_table_exists(thd, tables_start, 1, &exists))
DBUG_RETURN(TRUE); // Should never happen
if (exists)
{
if (thd->lex->create_info.options & HA_LEX_CREATE_IF_NOT_EXISTS)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
tables_start->table_name);
}
else
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), tables_start->table_name);
DBUG_RETURN(TRUE);
}
/* purecov: begin inspected */
/*
We got error from acquire_locks but table didn't exists.
In theory this should never happen, except maybe in
CREATE or DROP DATABASE scenario.
We play safe and restart the original acquire_locks with the
original timeout
*/
create_table= 0;
lock_wait_timeout= org_lock_wait_timeout;
/* purecov: end */
}
}

View File

@ -302,7 +302,8 @@ TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db,
const char *table_name,
bool no_error);
void mark_tmp_table_for_reuse(TABLE *table);
bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists);
bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool fast_check,
bool *exists);
int update_virtual_fields(THD *thd, TABLE *table,
enum enum_vcol_update_mode vcol_update_mode= VCOL_UPDATE_FOR_READ);
int dynamic_column_error_message(enum_dyncol_func_result rc);

View File

@ -1444,7 +1444,6 @@ THD::~THD()
mysql_mutex_lock(&LOCK_thd_data);
mysys_var=0; // Safety (shouldn't be needed)
mysql_mutex_unlock(&LOCK_thd_data);
add_to_status(&global_status_var, &status_var);
/* Close connection */
#ifndef EMBEDDED_LIBRARY

View File

@ -939,7 +939,7 @@ update_binlog:
char quoted_name[FN_REFLEN+3];
// Only write drop table to the binlog for tables that no longer exist.
if (check_if_table_exists(thd, tbl, &exists))
if (check_if_table_exists(thd, tbl, 0, &exists))
{
error= true;
goto exit;

View File

@ -2512,7 +2512,14 @@ case SQLCOM_PREPARE:
goto end_with_restore_list;
}
if (!(res= open_and_lock_tables(thd, lex->query_tables, TRUE, 0)))
res= open_and_lock_tables(thd, lex->query_tables, TRUE, 0);
if (res)
{
/* Got error or warning. Set res to 1 if error */
if (!(res= thd->is_error()))
my_ok(thd); // CREATE ... IF NOT EXISTS
}
else
{
/* The table already exists */
if (create_table->table)

View File

@ -7335,10 +7335,10 @@ JOIN_TAB *next_breadth_first_tab(JOIN *join, enum enum_exec_or_opt tabs_kind,
}
JOIN_TAB *first_top_level_tab(JOIN *join, enum enum_with_const_tables with_const)
JOIN_TAB *first_top_level_tab(JOIN *join, enum enum_with_const_tables const_tbls)
{
JOIN_TAB *tab= join->join_tab;
if (with_const == WITH_CONST_TABLES)
if (const_tbls == WITHOUT_CONST_TABLES)
{
if (join->const_tables == join->table_count)
return NULL;

View File

@ -3185,13 +3185,13 @@ bool get_lookup_value(THD *thd, Item_func *item_func,
Item_field *item_field;
CHARSET_INFO *cs= system_charset_info;
if (item_func->arguments()[0]->type() == Item::FIELD_ITEM &&
if (item_func->arguments()[0]->real_item()->type() == Item::FIELD_ITEM &&
item_func->arguments()[1]->const_item())
{
idx_field= 0;
idx_val= 1;
}
else if (item_func->arguments()[1]->type() == Item::FIELD_ITEM &&
else if (item_func->arguments()[1]->real_item()->type() == Item::FIELD_ITEM &&
item_func->arguments()[0]->const_item())
{
idx_field= 1;
@ -3200,7 +3200,7 @@ bool get_lookup_value(THD *thd, Item_func *item_func,
else
return 0;
item_field= (Item_field*) item_func->arguments()[idx_field];
item_field= (Item_field*) item_func->arguments()[idx_field]->real_item();
if (table->table != item_field->field->table)
return 0;
tmp_str= item_func->arguments()[idx_val]->val_str(&str_buff);

View File

@ -4137,7 +4137,8 @@ bool mysql_create_table_no_lock(THD *thd,
set_table_default_charset(thd, create_info, (char*) db);
db_options= create_info->table_options;
if (create_info->row_type != ROW_TYPE_FIXED &&
if (!create_info->frm_only &&
create_info->row_type != ROW_TYPE_FIXED &&
create_info->row_type != ROW_TYPE_DEFAULT)
db_options|= HA_OPTION_PACK_RECORD;
alias= table_case_name(create_info, table_name);
@ -4564,7 +4565,8 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table,
*/
if (open_and_lock_tables(thd, thd->lex->query_tables, FALSE, 0))
{
result= TRUE;
/* is_error() may be 0 if table existed and we generated a warning */
result= thd->is_error();
goto end;
}
@ -4759,7 +4761,10 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
properly isolated from all concurrent operations which matter.
*/
if (open_tables(thd, &thd->lex->query_tables, &not_used, 0))
{
res= thd->is_error();
goto err;
}
src_table->table->use_all_columns();
DEBUG_SYNC(thd, "create_table_like_after_open");
@ -6779,9 +6784,19 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
my_sleep(100000););
/*
Create a table with a temporary name.
With create_info->frm_only == 1 this creates a .frm file only.
With create_info->frm_only == 1 this creates a .frm file only and
we keep the original row format.
We don't log the statement, it will be logged later.
*/
if (need_copy_table == ALTER_TABLE_METADATA_ONLY)
{
DBUG_ASSERT(create_info->frm_only);
/* Ensure we keep the original table format */
create_info->table_options= ((create_info->table_options &
~HA_OPTION_PACK_RECORD) |
(table->s->db_create_options &
HA_OPTION_PACK_RECORD));
}
tmp_disable_binlog(thd);
error= mysql_create_table_no_lock(thd, new_db, tmp_name,
create_info,

View File

@ -173,7 +173,6 @@ void threadpool_remove_connection(THD *thd)
close_connection(thd, 0);
unlink_thd(thd);
mysql_mutex_unlock(&LOCK_thread_count);
mysql_cond_broadcast(&COND_thread_count);
/*

View File

@ -501,13 +501,7 @@ mutex_spin_wait(
{
ulint index; /* index of the reserved wait cell */
ulint i; /* spin round count */
#ifdef UNIV_DEBUG
ib_int64_t lstart_time = 0, lfinish_time; /* for timing os_wait */
ulint ltime_diff;
ulint sec;
ulint ms;
uint timer_started = 0;
#endif /* UNIV_DEBUG */
ut_ad(mutex);
/* This update is not thread safe, but we don't mind if the count
@ -540,13 +534,6 @@ spin_loop:
if (i == SYNC_SPIN_ROUNDS) {
#ifdef UNIV_DEBUG
mutex->count_os_yield++;
#ifndef UNIV_HOTBACKUP
if (timed_mutexes && timer_started == 0) {
ut_usectime(&sec, &ms);
lstart_time= (ib_int64_t)sec * 1000000 + ms;
timer_started = 1;
}
#endif /* UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
os_thread_yield();
}
@ -639,34 +626,13 @@ spin_loop:
mutex_os_wait_count++;
mutex->count_os_wait++;
#ifdef UNIV_DEBUG
/* !!!!! Sometimes os_wait can be called without os_thread_yield */
#ifndef UNIV_HOTBACKUP
if (timed_mutexes == 1 && timer_started == 0) {
ut_usectime(&sec, &ms);
lstart_time= (ib_int64_t)sec * 1000000 + ms;
timer_started = 1;
}
#endif /* UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
sync_array_wait_event(sync_primary_wait_array, index);
goto mutex_loop;
finish_timing:
#ifdef UNIV_DEBUG
if (timed_mutexes == 1 && timer_started==1) {
ut_usectime(&sec, &ms);
lfinish_time= (ib_int64_t)sec * 1000000 + ms;
ltime_diff= (ulint) (lfinish_time - lstart_time);
mutex->lspent_time += ltime_diff;
if (mutex->lmax_spent_time < ltime_diff) {
mutex->lmax_spent_time= ltime_diff;
}
}
#endif /* UNIV_DEBUG */
return;
}

View File

@ -157,6 +157,7 @@ mySTL/algorithm\.hpp: is used uninitialized in this function
# Groff warnings on OpenSUSE.
#
.*/dbug/.*(groff|<standard input>) : .*
.*groff.* : vertical spacing must be greater than
#
# Warnings on OpenSolaris

View File

@ -19072,7 +19072,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug58036", test_bug58036 },
{ "test_bug57058", test_bug57058 },
{ "test_bug56976", test_bug56976 },
{ "test_mdev3855", test_mdev3885 },
{ "test_mdev3885", test_mdev3885 },
{ "test_bug11766854", test_bug11766854 },
{ "test_bug12337762", test_bug12337762 },
{ "test_progress_reporting", test_progress_reporting },

View File

@ -43,6 +43,8 @@
<Property Id="SKIPNETWORKING" Secure="yes"/>
<!-- Whether to keep default (unauthenticated) user. Default is no-->
<Property Id="DEFAULTUSER" Secure="yes"/>
<!-- Set server character set to UTF8 -->
<Property Id="UTF8" Secure="yes"/>
<!-- Whether to data on uninstall (default yes, after asking user consent) -->
<Property Id="CLEANUPDATA" Secure="yes" Value="1"/>
<!-- Force per machine installation -->
@ -272,6 +274,10 @@
<Text>Please note: this setting can lead to insecure systems.</Text>
</Control>
<Control Id="CheckBoxUTF8" Type="CheckBox" X="8" Y="215" Width="250" Height="18" Property="UTF8" CheckBoxValue="1" TabSkip="no">
<Text>{\Font1}Use UTF8 as default server's character set</Text>
</Control>
<!-- Navigation buttons-->
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
<Publish Event="NewDialog" Value="CustomizeDlg">1</Publish>
@ -519,6 +525,20 @@
Value="ON" />
</Component>
<Component Id="C.utf8" Guid="*" Directory="DATADIR">
<Condition>UTF8</Condition>
<RegistryValue Root='HKLM'
Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
Name='UTF8' Value='1' Type='string' KeyPath='yes'/>
<IniFile Id="Ini6"
Action="createLine"
Directory="DATADIR"
Section="mysqld"
Name="my.ini"
Key="character-set-server"
Value="utf8" />
</Component>
<!--- Grant service account permission to the database folder (Windows 7 and later) -->
<Component Id="C.serviceaccount.permission" Guid="*" Directory='DATADIR' Transitive='yes'>
<Condition><![CDATA[SERVICENAME AND (VersionNT > 600)]]></Condition>