Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
bdd43744
Commit
bdd43744
authored
Sep 07, 2009
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Plain Diff
Automerge
parents
dd407c52
12a38fc6
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
1153 additions
and
91 deletions
+1153
-91
include/my_sys.h
include/my_sys.h
+1
-0
mysql-test/extra/rpl_tests/rpl_row_sp006.test
mysql-test/extra/rpl_tests/rpl_row_sp006.test
+19
-22
mysql-test/include/have_dynamic_loading.inc
mysql-test/include/have_dynamic_loading.inc
+7
-0
mysql-test/include/have_example_plugin.inc
mysql-test/include/have_example_plugin.inc
+1
-4
mysql-test/include/have_simple_parser.inc
mysql-test/include/have_simple_parser.inc
+1
-4
mysql-test/include/have_udf.inc
mysql-test/include/have_udf.inc
+1
-4
mysql-test/r/create.result
mysql-test/r/create.result
+13
-0
mysql-test/r/ctype_gbk_binlog.result
mysql-test/r/ctype_gbk_binlog.result
+1
-0
mysql-test/r/explain.result
mysql-test/r/explain.result
+8
-0
mysql-test/r/mysqlbinlog-cp932.result
mysql-test/r/mysqlbinlog-cp932.result
+1
-1
mysql-test/r/sp.result
mysql-test/r/sp.result
+16
-0
mysql-test/suite/binlog/r/binlog_incident.result
mysql-test/suite/binlog/r/binlog_incident.result
+1
-0
mysql-test/suite/binlog/r/binlog_tmp_table.result
mysql-test/suite/binlog/r/binlog_tmp_table.result
+1
-0
mysql-test/suite/binlog/t/binlog_incident.test
mysql-test/suite/binlog/t/binlog_incident.test
+2
-1
mysql-test/suite/binlog/t/binlog_tmp_table.test
mysql-test/suite/binlog/t/binlog_tmp_table.test
+1
-0
mysql-test/suite/parts/inc/partition_auto_increment.inc
mysql-test/suite/parts/inc/partition_auto_increment.inc
+192
-0
mysql-test/suite/parts/r/partition_auto_increment_innodb.result
...test/suite/parts/r/partition_auto_increment_innodb.result
+191
-0
mysql-test/suite/parts/r/partition_auto_increment_memory.result
...test/suite/parts/r/partition_auto_increment_memory.result
+191
-0
mysql-test/suite/parts/r/partition_auto_increment_myisam.result
...test/suite/parts/r/partition_auto_increment_myisam.result
+191
-0
mysql-test/suite/parts/r/partition_auto_increment_ndb.result
mysql-test/suite/parts/r/partition_auto_increment_ndb.result
+191
-0
mysql-test/suite/parts/t/partition_auto_increment_archive.test
...-test/suite/parts/t/partition_auto_increment_archive.test
+3
-0
mysql-test/suite/parts/t/partition_auto_increment_blackhole.test
...est/suite/parts/t/partition_auto_increment_blackhole.test
+3
-0
mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
+17
-19
mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
+17
-19
mysql-test/t/create.test
mysql-test/t/create.test
+17
-0
mysql-test/t/ctype_gbk_binlog.test
mysql-test/t/ctype_gbk_binlog.test
+1
-0
mysql-test/t/explain.test
mysql-test/t/explain.test
+11
-0
mysql-test/t/mysqlbinlog-cp932.test
mysql-test/t/mysqlbinlog-cp932.test
+3
-2
mysql-test/t/ps_not_windows.test
mysql-test/t/ps_not_windows.test
+2
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+22
-0
mysys/my_copy.c
mysys/my_copy.c
+7
-0
sql/ha_partition.cc
sql/ha_partition.cc
+2
-2
sql/ha_partition.h
sql/ha_partition.h
+3
-1
sql/item_subselect.cc
sql/item_subselect.cc
+4
-6
sql/sql_insert.cc
sql/sql_insert.cc
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+1
-1
sql/sql_table.cc
sql/sql_table.cc
+6
-1
storage/myisam/myisamchk.c
storage/myisam/myisamchk.c
+3
-3
No files found.
include/my_sys.h
View file @
bdd43744
...
...
@@ -67,6 +67,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_HOLD_ON_ERROR 256
/* my_realloc() ; Return old ptr on error */
#define MY_DONT_OVERWRITE_FILE 1024
/* my_copy: Don't overwrite file */
#define MY_THREADSAFE 2048
/* my_seek(): lock fd mutex */
#define MY_SYNC 4096
/* my_copy(): sync dst file */
#define MY_CHECK_ERROR 1
/* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2
/* Give time info about process*/
...
...
mysql-test/extra/rpl_tests/rpl_row_sp006.test
View file @
bdd43744
...
...
@@ -9,29 +9,27 @@
#############################################################################
# Begin clean up test section
connection
master
;
--
disable_warnings
create
database
if
not
exists
mysqltest1
;
DROP
PROCEDURE
IF
EXISTS
mysqltest1
.
p1
;
DROP
PROCEDURE
IF
EXISTS
mysqltest1
.
p2
;
DROP
TABLE
IF
EXISTS
mysqltest1
.
t2
;
DROP
TABLE
IF
EXISTS
mysqltest1
.
t1
;
DROP
TABLE
IF
EXISTS
t1
;
DROP
TABLE
IF
EXISTS
t2
;
DROP
PROCEDURE
IF
EXISTS
p1
;
DROP
PROCEDURE
IF
EXISTS
p2
;
--
enable_warnings
# End of cleanup
# Begin test section 1
eval
CREATE
TABLE
IF
NOT
EXISTS
mysqltest1
.
t1
(
name
CHAR
(
16
),
birth
DATE
,
PRIMARY
KEY
(
name
))
ENGINE
=
$engine_type
;
eval
CREATE
TABLE
IF
NOT
EXISTS
mysqltest1
.
t2
(
name
CHAR
(
16
),
age
INT
,
PRIMARY
KEY
(
name
))
ENGINE
=
$engine_type
;
eval
CREATE
TABLE
IF
NOT
EXISTS
t1
(
name
CHAR
(
16
),
birth
DATE
,
PRIMARY
KEY
(
name
))
ENGINE
=
$engine_type
;
eval
CREATE
TABLE
IF
NOT
EXISTS
t2
(
name
CHAR
(
16
),
age
INT
,
PRIMARY
KEY
(
name
))
ENGINE
=
$engine_type
;
delimiter
|
;
CREATE
PROCEDURE
mysqltest1
.
p1
()
CREATE
PROCEDURE
p1
()
BEGIN
DECLARE
done
INT
DEFAULT
0
;
DECLARE
spa
CHAR
(
16
);
DECLARE
spb
INT
;
DECLARE
cur1
CURSOR
FOR
SELECT
name
,
(
YEAR
(
CURDATE
())
-
YEAR
(
birth
))
-
(
RIGHT
(
CURDATE
(),
5
)
<
RIGHT
(
birth
,
5
))
FROM
mysqltest1
.
t1
;
FROM
t1
;
DECLARE
CONTINUE
HANDLER
FOR
SQLSTATE
'02000'
SET
done
=
1
;
OPEN
cur1
;
...
...
@@ -41,7 +39,7 @@ BEGIN
FETCH
cur1
INTO
spa
,
spb
;
IF
NOT
done
THEN
START
TRANSACTION
;
INSERT
INTO
mysqltest1
.
t2
VALUES
(
spa
,
spb
);
INSERT
INTO
t2
VALUES
(
spa
,
spb
);
COMMIT
;
END
IF
;
UNTIL
done
END
REPEAT
;
...
...
@@ -49,30 +47,29 @@ BEGIN
SET
AUTOCOMMIT
=
1
;
CLOSE
cur1
;
END
|
CREATE
PROCEDURE
mysqltest1
.
p2
()
CREATE
PROCEDURE
p2
()
BEGIN
INSERT
INTO
mysqltest1
.
t1
VALUES
(
'MySQL'
,
'1993-02-04'
),(
'ROCKS'
,
'1990-08-27'
),(
'Texas'
,
'1999-03-30'
),(
'kyle'
,
'2005-1-1'
);
INSERT
INTO
t1
VALUES
(
'MySQL'
,
'1993-02-04'
),(
'ROCKS'
,
'1990-08-27'
),(
'Texas'
,
'1999-03-30'
),(
'kyle'
,
'2005-1-1'
);
END
|
delimiter
;
|
CALL
mysqltest1
.
p2
();
CALL
p2
();
sync_slave_with_master
;
connection
master
;
CALL
mysqltest1
.
p1
();
CALL
p1
();
sync_slave_with_master
;
connection
master
;
--
exec
$MYSQL_DUMP
--
compact
--
order
-
by
-
primary
--
skip
-
extended
-
insert
--
no
-
create
-
info
mysqltest1
>
$MYSQLTEST_VARDIR
/
tmp
/
sp006_master
.
sql
--
exec
$MYSQL_DUMP_SLAVE
--
compact
--
order
-
by
-
primary
--
skip
-
extended
-
insert
--
no
-
create
-
info
mysqltest1
>
$MYSQLTEST_VARDIR
/
tmp
/
sp006_slave
.
sql
--
exec
$MYSQL_DUMP
--
compact
--
order
-
by
-
primary
--
skip
-
extended
-
insert
--
no
-
create
-
info
test
>
$MYSQLTEST_VARDIR
/
tmp
/
sp006_master
.
sql
--
exec
$MYSQL_DUMP_SLAVE
--
compact
--
order
-
by
-
primary
--
skip
-
extended
-
insert
--
no
-
create
-
info
test
>
$MYSQLTEST_VARDIR
/
tmp
/
sp006_slave
.
sql
DROP
PROCEDURE
IF
EXISTS
mysqltest1
.
p1
;
DROP
PROCEDURE
IF
EXISTS
mysqltest1
.
p2
;
DROP
TABLE
IF
EXISTS
mysqltest1
.
t1
;
DROP
TABLE
IF
EXISTS
mysqltest1
.
t2
;
DROP
DATABASE
mysqltest1
;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
DROP
PROCEDURE
p1
;
DROP
PROCEDURE
p2
;
# Lets compare. Note: If they match test will pass, if they do not match
# the test will show that the diff statement failed and not reject file
...
...
mysql-test/include/have_dynamic_loading.inc
0 → 100644
View file @
bdd43744
#
# Whether server supports dynamic loading.
#
--
require
r
/
have_dynamic_loading
.
require
disable_query_log
;
show
variables
like
'have_dynamic_loading'
;
enable_query_log
;
mysql-test/include/have_example_plugin.inc
View file @
bdd43744
...
...
@@ -2,10 +2,7 @@
# Check if server has support for loading udf's
# i.e it will support dlopen
#
--
require
r
/
have_dynamic_loading
.
require
disable_query_log
;
show
variables
like
'have_dynamic_loading'
;
enable_query_log
;
--
source
include
/
have_dynamic_loading
.
inc
#
# Check if the variable EXAMPLE_PLUGIN is set
...
...
mysql-test/include/have_simple_parser.inc
View file @
bdd43744
...
...
@@ -2,10 +2,7 @@
# Check if server has support for loading udf's
# i.e it will support dlopen
#
--
require
r
/
have_dynamic_loading
.
require
disable_query_log
;
show
variables
like
'have_dynamic_loading'
;
enable_query_log
;
--
source
include
/
have_dynamic_loading
.
inc
#
# Check if the variable SIMPLE_PARSER is set
...
...
mysql-test/include/have_udf.inc
View file @
bdd43744
...
...
@@ -2,10 +2,7 @@
# Check if server has support for loading udf's
# i.e it will support dlopen
#
--
require
r
/
have_dynamic_loading
.
require
disable_query_log
;
show
variables
like
'have_dynamic_loading'
;
enable_query_log
;
--
source
include
/
have_dynamic_loading
.
inc
#
# Check if the variable UDF_EXAMPLE_LIB is set
...
...
mysql-test/r/create.result
View file @
bdd43744
...
...
@@ -1572,6 +1572,19 @@ CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
DROP TABLE t1, t2;
#
# BUG#46384 - mysqld segfault when trying to create table with same
# name as existing view
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t2 VALUES (1),(2),(3);
CREATE VIEW v1 AS SELECT t1.a FROM t1, t2;
CREATE TABLE v1 AS SELECT * FROM t1;
ERROR 42S01: Table 'v1' already exists
DROP VIEW v1;
DROP TABLE t1,t2;
End of 5.0 tests
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
...
...
mysql-test/r/ctype_gbk_binlog.result
View file @
bdd43744
RESET MASTER;
SET NAMES gbk;
CREATE TABLE t1 (
f1 BLOB
...
...
mysql-test/r/explain.result
View file @
bdd43744
...
...
@@ -159,6 +159,14 @@ CREATE TABLE t1 (a INT PRIMARY KEY);
EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
ERROR 42000: Key 'a' doesn't exist in table 't1'
DROP TABLE t1;
CREATE TABLE t1(a LONGTEXT);
INSERT INTO t1 VALUES (repeat('a',@@global.max_allowed_packet));
INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet));
EXPLAIN SELECT DISTINCT 1 FROM t1,
(SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) as d1
WHERE t1.a = d1.a;
ERROR 42S22: Unknown column 'd1.a' in 'where clause'
DROP TABLE t1;
#
# Bug#37870: Usage of uninitialized value caused failed assertion.
#
...
...
mysql-test/r/mysqlbinlog-cp932.result
View file @
bdd43744
flush logs
;
RESET MASTER
;
create table t3 (f text character set utf8);
create table t4 (f text character set cp932);
flush logs;
...
...
mysql-test/r/sp.result
View file @
bdd43744
...
...
@@ -6963,6 +6963,22 @@ CALL p1();
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
#
# Bug #46629: Item_in_subselect::val_int(): Assertion `0'
# on subquery inside a SP
#
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT, b INT PRIMARY KEY);
CREATE PROCEDURE p1 ()
BEGIN
SELECT a FROM t1 A WHERE A.b IN (SELECT b FROM t2 AS B);
END|
CALL p1;
ERROR 42S22: Unknown column 'A.b' in 'IN/ALL/ANY subquery'
CALL p1;
ERROR 42S22: Unknown column 'A.b' in 'IN/ALL/ANY subquery'
DROP PROCEDURE p1;
DROP TABLE t1, t2;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
mysql-test/suite/binlog/r/binlog_incident.result
View file @
bdd43744
RESET MASTER;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT * FROM t1;
...
...
mysql-test/suite/binlog/r/binlog_tmp_table.result
View file @
bdd43744
RESET MASTER;
create table foo (a int);
flush logs;
create temporary table tmp1_foo like foo;
...
...
mysql-test/suite/binlog/t/binlog_incident.test
View file @
bdd43744
...
...
@@ -6,6 +6,7 @@ source include/have_log_bin.inc;
source
include
/
have_debug
.
inc
;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
RESET
MASTER
;
CREATE
TABLE
t1
(
a
INT
);
...
...
@@ -24,4 +25,4 @@ exec $MYSQL_BINLOG --start-position=106 $MYSQLD_DATADIR/master-bin.000001 >$MYSQ
eval
SELECT
cont
LIKE
'%RELOAD DATABASE; # Shall generate syntax error%'
AS
`Contain RELOAD DATABASE`
FROM
(
SELECT
load_file
(
'$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql'
)
AS
cont
)
AS
tbl
;
--
enable_query_log
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
binlog_incident
-
bug44442
.
sql
;
\ No newline at end of file
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
binlog_incident
-
bug44442
.
sql
;
mysql-test/suite/binlog/t/binlog_tmp_table.test
View file @
bdd43744
...
...
@@ -30,6 +30,7 @@ source include/have_binlog_format_mixed_or_statement.inc;
connect
(
master
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_MYPORT
,);
connect
(
master1
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_MYPORT
,);
RESET
MASTER
;
create
table
foo
(
a
int
);
...
...
mysql-test/suite/parts/inc/partition_auto_increment.inc
View file @
bdd43744
...
...
@@ -623,3 +623,195 @@ SHOW CREATE TABLE t1;
SELECT
*
FROM
t1
ORDER
BY
c1
;
DROP
TABLE
t1
;
if
(
!
$skip_negative_auto_inc
)
{
--
echo
#############################################################################
--
echo
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
--
echo
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
--
echo
##############################################################################
--
echo
# Inserting negative autoincrement values into a partition table (partitions >= 4)
eval
CREATE
TABLE
t
(
c1
INT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
4
;
INSERT
INTO
t
(
c2
)
VALUES
(
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
20
);
INSERT
INTO
t
VALUES
(
-
1
,
-
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
30
);
INSERT
INTO
t
(
c2
)
VALUES
(
40
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
# Reading from a partition table (partitions >= 2 ) after inserting a negative
--
echo
# value into the auto increment column
eval
CREATE
TABLE
t
(
c1
INT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
2
;
INSERT
INTO
t
VALUES
(
-
2
,
-
20
);
INSERT
INTO
t
(
c2
)
VALUES
(
30
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
# Inserting negative auto increment value into a partition table (partitions >= 2)
--
echo
# auto increment value > 2.
eval
CREATE
TABLE
t
(
c1
INT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
2
;
INSERT
INTO
t
VALUES
(
-
4
,
-
20
);
INSERT
INTO
t
(
c2
)
VALUES
(
30
);
INSERT
INTO
t
(
c2
)
VALUES
(
40
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
eval
CREATE
TABLE
t
(
c1
INT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
4
;
INSERT
INTO
t
(
c2
)
VALUES
(
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
20
);
INSERT
INTO
t
VALUES
(
-
1
,
-
10
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
INSERT
INTO
t
(
c2
)
VALUES
(
30
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
# Deleting from an auto increment table after inserting negative values
eval
CREATE
TABLE
t
(
c1
INT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
4
;
INSERT
INTO
t
(
c2
)
VALUES
(
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
20
);
INSERT
INTO
t
VALUES
(
-
1
,
-
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
30
);
INSERT
INTO
t
VALUES
(
-
3
,
-
20
);
INSERT
INTO
t
(
c2
)
VALUES
(
40
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
if
(
!
$skip_delete
)
{
DELETE
FROM
t
WHERE
c1
>
1
;
}
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
# Inserting a positive value that exceeds maximum allowed value for an
--
echo
# Auto Increment column (positive maximum)
eval
CREATE
TABLE
t
(
c1
TINYINT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
4
;
INSERT
INTO
t
(
c2
)
VALUES
(
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
20
);
INSERT
INTO
t
VALUES
(
126
,
30
);
INSERT
INTO
t
VALUES
(
127
,
40
);
--
error
ER_DUP_ENTRY
INSERT
INTO
t
VALUES
(
128
,
50
);
--
error
ER_DUP_ENTRY
INSERT
INTO
t
VALUES
(
129
,
60
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
# Inserting a negative value that goes below minimum allowed value for an
--
echo
# Auto Increment column (negative minimum)
eval
CREATE
TABLE
t
(
c1
TINYINT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
4
;
INSERT
INTO
t
(
c2
)
VALUES
(
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
20
);
INSERT
INTO
t
VALUES
(
-
127
,
30
);
INSERT
INTO
t
VALUES
(
-
128
,
40
);
--
error
ER_DUP_ENTRY
INSERT
INTO
t
VALUES
(
-
129
,
50
);
--
error
ER_DUP_ENTRY
INSERT
INTO
t
VALUES
(
-
130
,
60
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
# Updating the partition table with a negative Auto Increment value
eval
CREATE
TABLE
t
(
c1
INT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
4
;
INSERT
INTO
t
(
c2
)
VALUES
(
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
20
);
INSERT
INTO
t
VALUES
(
-
1
,
-
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
30
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
if
(
!
$skip_update
)
{
UPDATE
t
SET
c1
=
-
6
WHERE
c1
=
2
;
}
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
INSERT
INTO
t
(
c2
)
VALUES
(
40
);
INSERT
INTO
t
(
c2
)
VALUES
(
50
);
if
(
!
$skip_update
)
{
UPDATE
t
SET
c1
=
-
6
WHERE
c1
=
2
;
}
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
# Updating the partition table with a value that crosses the upper limits
--
echo
# on both the positive and the negative side.
eval
CREATE
TABLE
t
(
c1
TINYINT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
c1
),
c2
INT
)
ENGINE
=
$engine
PARTITION
BY
HASH
(
c1
)
PARTITIONS
4
;
INSERT
INTO
t
(
c2
)
VALUES
(
10
);
INSERT
INTO
t
(
c2
)
VALUES
(
20
);
INSERT
INTO
t
VALUES
(
126
,
30
);
INSERT
INTO
t
VALUES
(
127
,
40
);
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
if
(
!
$skip_update
)
{
UPDATE
t
SET
c1
=
130
where
c1
=
127
;
}
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
if
(
!
$skip_update
)
{
UPDATE
t
SET
c1
=
-
140
where
c1
=
126
;
}
SELECT
*
FROM
t
ORDER
BY
c1
ASC
;
DROP
TABLE
t
;
--
echo
##############################################################################
}
mysql-test/suite/parts/r/partition_auto_increment_innodb.result
View file @
bdd43744
...
...
@@ -825,3 +825,194 @@ c1
4
5
DROP TABLE t1;
#############################################################################
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
##############################################################################
# Inserting negative autoincrement values into a partition table (partitions >= 4)
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
4 40
DROP TABLE t;
# Reading from a partition table (partitions >= 2 ) after inserting a negative
# value into the auto increment column
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 2;
INSERT INTO t VALUES (-2,-20);
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-2 -20
1 30
DROP TABLE t;
# Inserting negative auto increment value into a partition table (partitions >= 2)
# auto increment value > 2.
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 2;
INSERT INTO t VALUES (-4,-20);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-4 -20
1 30
2 40
DROP TABLE t;
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
DROP TABLE t;
# Deleting from an auto increment table after inserting negative values
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t VALUES (-3,-20);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-3 -20
-1 -10
1 10
2 20
3 30
4 40
DELETE FROM t WHERE c1 > 1;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-3 -20
-1 -10
1 10
DROP TABLE t;
# Inserting a positive value that exceeds maximum allowed value for an
# Auto Increment column (positive maximum)
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (126,30);
INSERT INTO t VALUES (127,40);
INSERT INTO t VALUES (128,50);
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
INSERT INTO t VALUES (129,60);
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
DROP TABLE t;
# Inserting a negative value that goes below minimum allowed value for an
# Auto Increment column (negative minimum)
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-127,30);
INSERT INTO t VALUES (-128,40);
INSERT INTO t VALUES (-129,50);
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
INSERT INTO t VALUES (-130,60);
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-128 40
-127 30
1 10
2 20
DROP TABLE t;
# Updating the partition table with a negative Auto Increment value
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
UPDATE t SET c1 = -6 WHERE c1 = 2;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-6 20
-1 -10
1 10
3 30
INSERT INTO t(c2) VALUES (40);
INSERT INTO t(c2) VALUES (50);
UPDATE t SET c1 = -6 WHERE c1 = 2;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-6 20
-1 -10
1 10
3 30
4 40
5 50
DROP TABLE t;
# Updating the partition table with a value that crosses the upper limits
# on both the positive and the negative side.
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='InnoDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (126,30);
INSERT INTO t VALUES (127,40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
UPDATE t SET c1 = 130 where c1 = 127;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
UPDATE t SET c1 = -140 where c1 = 126;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-128 30
1 10
2 20
127 40
DROP TABLE t;
##############################################################################
mysql-test/suite/parts/r/partition_auto_increment_memory.result
View file @
bdd43744
...
...
@@ -851,3 +851,194 @@ c1
4
5
DROP TABLE t1;
#############################################################################
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
##############################################################################
# Inserting negative autoincrement values into a partition table (partitions >= 4)
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
4 40
DROP TABLE t;
# Reading from a partition table (partitions >= 2 ) after inserting a negative
# value into the auto increment column
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 2;
INSERT INTO t VALUES (-2,-20);
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-2 -20
1 30
DROP TABLE t;
# Inserting negative auto increment value into a partition table (partitions >= 2)
# auto increment value > 2.
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 2;
INSERT INTO t VALUES (-4,-20);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-4 -20
1 30
2 40
DROP TABLE t;
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
DROP TABLE t;
# Deleting from an auto increment table after inserting negative values
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t VALUES (-3,-20);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-3 -20
-1 -10
1 10
2 20
3 30
4 40
DELETE FROM t WHERE c1 > 1;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-3 -20
-1 -10
1 10
DROP TABLE t;
# Inserting a positive value that exceeds maximum allowed value for an
# Auto Increment column (positive maximum)
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (126,30);
INSERT INTO t VALUES (127,40);
INSERT INTO t VALUES (128,50);
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
INSERT INTO t VALUES (129,60);
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
DROP TABLE t;
# Inserting a negative value that goes below minimum allowed value for an
# Auto Increment column (negative minimum)
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-127,30);
INSERT INTO t VALUES (-128,40);
INSERT INTO t VALUES (-129,50);
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
INSERT INTO t VALUES (-130,60);
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-128 40
-127 30
1 10
2 20
DROP TABLE t;
# Updating the partition table with a negative Auto Increment value
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
UPDATE t SET c1 = -6 WHERE c1 = 2;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-6 20
-1 -10
1 10
3 30
INSERT INTO t(c2) VALUES (40);
INSERT INTO t(c2) VALUES (50);
UPDATE t SET c1 = -6 WHERE c1 = 2;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-6 20
-1 -10
1 10
3 30
4 40
5 50
DROP TABLE t;
# Updating the partition table with a value that crosses the upper limits
# on both the positive and the negative side.
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='Memory' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (126,30);
INSERT INTO t VALUES (127,40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
UPDATE t SET c1 = 130 where c1 = 127;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
UPDATE t SET c1 = -140 where c1 = 126;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-128 30
1 10
2 20
127 40
DROP TABLE t;
##############################################################################
mysql-test/suite/parts/r/partition_auto_increment_myisam.result
View file @
bdd43744
...
...
@@ -870,3 +870,194 @@ c1
4
5
DROP TABLE t1;
#############################################################################
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
##############################################################################
# Inserting negative autoincrement values into a partition table (partitions >= 4)
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
4 40
DROP TABLE t;
# Reading from a partition table (partitions >= 2 ) after inserting a negative
# value into the auto increment column
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 2;
INSERT INTO t VALUES (-2,-20);
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-2 -20
1 30
DROP TABLE t;
# Inserting negative auto increment value into a partition table (partitions >= 2)
# auto increment value > 2.
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 2;
INSERT INTO t VALUES (-4,-20);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-4 -20
1 30
2 40
DROP TABLE t;
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
DROP TABLE t;
# Deleting from an auto increment table after inserting negative values
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t VALUES (-3,-20);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-3 -20
-1 -10
1 10
2 20
3 30
4 40
DELETE FROM t WHERE c1 > 1;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-3 -20
-1 -10
1 10
DROP TABLE t;
# Inserting a positive value that exceeds maximum allowed value for an
# Auto Increment column (positive maximum)
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (126,30);
INSERT INTO t VALUES (127,40);
INSERT INTO t VALUES (128,50);
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
INSERT INTO t VALUES (129,60);
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
DROP TABLE t;
# Inserting a negative value that goes below minimum allowed value for an
# Auto Increment column (negative minimum)
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-127,30);
INSERT INTO t VALUES (-128,40);
INSERT INTO t VALUES (-129,50);
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
INSERT INTO t VALUES (-130,60);
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-128 40
-127 30
1 10
2 20
DROP TABLE t;
# Updating the partition table with a negative Auto Increment value
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
UPDATE t SET c1 = -6 WHERE c1 = 2;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-6 20
-1 -10
1 10
3 30
INSERT INTO t(c2) VALUES (40);
INSERT INTO t(c2) VALUES (50);
UPDATE t SET c1 = -6 WHERE c1 = 2;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-6 20
-1 -10
1 10
3 30
4 40
5 50
DROP TABLE t;
# Updating the partition table with a value that crosses the upper limits
# on both the positive and the negative side.
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='MyISAM' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (126,30);
INSERT INTO t VALUES (127,40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
UPDATE t SET c1 = 130 where c1 = 127;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
UPDATE t SET c1 = -140 where c1 = 126;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-128 30
1 10
2 20
127 40
DROP TABLE t;
##############################################################################
mysql-test/suite/parts/r/partition_auto_increment_ndb.result
View file @
bdd43744
...
...
@@ -846,3 +846,194 @@ c1
4
5
DROP TABLE t1;
#############################################################################
# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
##############################################################################
# Inserting negative autoincrement values into a partition table (partitions >= 4)
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
4 40
DROP TABLE t;
# Reading from a partition table (partitions >= 2 ) after inserting a negative
# value into the auto increment column
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 2;
INSERT INTO t VALUES (-2,-20);
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-2 -20
1 30
DROP TABLE t;
# Inserting negative auto increment value into a partition table (partitions >= 2)
# auto increment value > 2.
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 2;
INSERT INTO t VALUES (-4,-20);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-4 -20
1 30
2 40
DROP TABLE t;
# Inserting -1 into autoincrement column of a partition table (partition >= 4)
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
DROP TABLE t;
# Deleting from an auto increment table after inserting negative values
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
INSERT INTO t VALUES (-3,-20);
INSERT INTO t(c2) VALUES (40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-3 -20
-1 -10
1 10
2 20
3 30
4 40
DELETE FROM t WHERE c1 > 1;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-3 -20
-1 -10
1 10
DROP TABLE t;
# Inserting a positive value that exceeds maximum allowed value for an
# Auto Increment column (positive maximum)
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (126,30);
INSERT INTO t VALUES (127,40);
INSERT INTO t VALUES (128,50);
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
INSERT INTO t VALUES (129,60);
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
DROP TABLE t;
# Inserting a negative value that goes below minimum allowed value for an
# Auto Increment column (negative minimum)
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-127,30);
INSERT INTO t VALUES (-128,40);
INSERT INTO t VALUES (-129,50);
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
INSERT INTO t VALUES (-130,60);
ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-128 40
-127 30
1 10
2 20
DROP TABLE t;
# Updating the partition table with a negative Auto Increment value
CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (-1,-10);
INSERT INTO t(c2) VALUES (30);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-1 -10
1 10
2 20
3 30
UPDATE t SET c1 = -6 WHERE c1 = 2;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-6 20
-1 -10
1 10
3 30
INSERT INTO t(c2) VALUES (40);
INSERT INTO t(c2) VALUES (50);
UPDATE t SET c1 = -6 WHERE c1 = 2;
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-6 20
-1 -10
1 10
3 30
4 40
5 50
DROP TABLE t;
# Updating the partition table with a value that crosses the upper limits
# on both the positive and the negative side.
CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t(c2) VALUES (10);
INSERT INTO t(c2) VALUES (20);
INSERT INTO t VALUES (126,30);
INSERT INTO t VALUES (127,40);
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
UPDATE t SET c1 = 130 where c1 = 127;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
1 10
2 20
126 30
127 40
UPDATE t SET c1 = -140 where c1 = 126;
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
SELECT * FROM t ORDER BY c1 ASC;
c1 c2
-128 30
1 10
2 20
127 40
DROP TABLE t;
##############################################################################
mysql-test/suite/parts/t/partition_auto_increment_archive.test
View file @
bdd43744
...
...
@@ -30,6 +30,9 @@ let $skip_delete= 1;
let
$skip_truncate
=
1
;
let
$skip_update
=
1
;
let
$only_ai_pk
=
1
;
# Bug#45823 Assertion failure in file row/row0mysql.c line 1386
# Archive does not handle negative autoincrement values correctly
let
$skip_negative_auto_inc
=
1
;
##### Storage engine to be tested
let
$engine
=
'Archive'
;
...
...
mysql-test/suite/parts/t/partition_auto_increment_blackhole.test
View file @
bdd43744
...
...
@@ -25,6 +25,9 @@
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
--
source
include
/
have_blackhole
.
inc
# Bug#45823 Assertion failure in file row/row0mysql.c line 1386
# Blackhole does not handle negative autoincrement values correctly
let
$skip_negative_auto_inc
=
1
;
##### Storage engine to be tested
let
$engine
=
'Blackhole'
;
...
...
mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
View file @
bdd43744
...
...
@@ -4,21 +4,20 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create database if not exists mysqltest1;
DROP PROCEDURE IF EXISTS mysqltest1.p1;
DROP PROCEDURE IF EXISTS mysqltest1.p2;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=InnoDB;
CREATE PROCEDURE mysqltest1.p1()
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
CREATE TABLE IF NOT EXISTS t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=InnoDB;
CREATE PROCEDURE p1()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE spa CHAR(16);
DECLARE spb INT;
DECLARE cur1 CURSOR FOR SELECT name,
(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
FROM
mysqltest1.
t1;
FROM t1;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
OPEN cur1;
SET AUTOCOMMIT=0;
...
...
@@ -26,21 +25,20 @@ REPEAT
FETCH cur1 INTO spa, spb;
IF NOT done THEN
START TRANSACTION;
INSERT INTO
mysqltest1.
t2 VALUES (spa,spb);
INSERT INTO t2 VALUES (spa,spb);
COMMIT;
END IF;
UNTIL done END REPEAT;
SET AUTOCOMMIT=1;
CLOSE cur1;
END|
CREATE PROCEDURE
mysqltest1.
p2()
CREATE PROCEDURE p2()
BEGIN
INSERT INTO
mysqltest1.
t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
END|
CALL mysqltest1.p2();
CALL mysqltest1.p1();
DROP PROCEDURE IF EXISTS mysqltest1.p1;
DROP PROCEDURE IF EXISTS mysqltest1.p2;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP DATABASE mysqltest1;
CALL p2();
CALL p1();
DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
View file @
bdd43744
...
...
@@ -4,21 +4,20 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create database if not exists mysqltest1;
DROP PROCEDURE IF EXISTS mysqltest1.p1;
DROP PROCEDURE IF EXISTS mysqltest1.p2;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
CREATE PROCEDURE mysqltest1.p1()
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
CREATE TABLE IF NOT EXISTS t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
CREATE TABLE IF NOT EXISTS t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
CREATE PROCEDURE p1()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE spa CHAR(16);
DECLARE spb INT;
DECLARE cur1 CURSOR FOR SELECT name,
(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
FROM
mysqltest1.
t1;
FROM t1;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
OPEN cur1;
SET AUTOCOMMIT=0;
...
...
@@ -26,21 +25,20 @@ REPEAT
FETCH cur1 INTO spa, spb;
IF NOT done THEN
START TRANSACTION;
INSERT INTO
mysqltest1.
t2 VALUES (spa,spb);
INSERT INTO t2 VALUES (spa,spb);
COMMIT;
END IF;
UNTIL done END REPEAT;
SET AUTOCOMMIT=1;
CLOSE cur1;
END|
CREATE PROCEDURE
mysqltest1.
p2()
CREATE PROCEDURE p2()
BEGIN
INSERT INTO
mysqltest1.
t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
END|
CALL mysqltest1.p2();
CALL mysqltest1.p1();
DROP PROCEDURE IF EXISTS mysqltest1.p1;
DROP PROCEDURE IF EXISTS mysqltest1.p2;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP DATABASE mysqltest1;
CALL p2();
CALL p1();
DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
mysql-test/t/create.test
View file @
bdd43744
...
...
@@ -1198,6 +1198,23 @@ CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# BUG#46384 - mysqld segfault when trying to create table with same
--
echo
# name as existing view
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t2
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
),(
3
);
INSERT
INTO
t2
VALUES
(
1
),(
2
),(
3
);
CREATE
VIEW
v1
AS
SELECT
t1
.
a
FROM
t1
,
t2
;
--
error
ER_TABLE_EXISTS_ERROR
CREATE
TABLE
v1
AS
SELECT
*
FROM
t1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.0
tests
...
...
mysql-test/t/ctype_gbk_binlog.test
View file @
bdd43744
--
source
include
/
have_binlog_format_mixed_or_statement
.
inc
--
source
include
/
have_gbk
.
inc
RESET
MASTER
;
SET
NAMES
gbk
;
--
character_set
gbk
...
...
mysql-test/t/explain.test
View file @
bdd43744
...
...
@@ -135,6 +135,17 @@ EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
DROP
TABLE
t1
;
#
# Bug#45989 memory leak after explain encounters an error in the query
#
CREATE
TABLE
t1
(
a
LONGTEXT
);
INSERT
INTO
t1
VALUES
(
repeat
(
'a'
,
@@
global
.
max_allowed_packet
));
INSERT
INTO
t1
VALUES
(
repeat
(
'b'
,
@@
global
.
max_allowed_packet
));
--
error
ER_BAD_FIELD_ERROR
EXPLAIN
SELECT
DISTINCT
1
FROM
t1
,
(
SELECT
DISTINCTROW
a
AS
away
FROM
t1
GROUP
BY
a
WITH
ROLLUP
)
as
d1
WHERE
t1
.
a
=
d1
.
a
;
DROP
TABLE
t1
;
# End of 5.0 tests.
...
...
mysql-test/t/mysqlbinlog-cp932.test
View file @
bdd43744
...
...
@@ -5,8 +5,9 @@
--
source
include
/
have_cp932
.
inc
--
source
include
/
have_log_bin
.
inc
RESET
MASTER
;
# Bug#16217 (mysql client did not know how not switch its internal charset)
flush
logs
;
create
table
t3
(
f
text
character
set
utf8
);
create
table
t4
(
f
text
character
set
cp932
);
--
exec
$MYSQL
--
default
-
character
-
set
=
utf8
test
-
e
"insert into t3 values(_utf8'ソ')"
...
...
@@ -14,7 +15,7 @@ create table t4 (f text character set cp932);
flush
logs
;
rename
table
t3
to
t03
,
t4
to
t04
;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
--
exec
$MYSQL_BINLOG
--
short
-
form
$MYSQLD_DATADIR
/
master
-
bin
.
00000
2
|
$MYSQL
--
default
-
character
-
set
=
utf8
--
exec
$MYSQL_BINLOG
--
short
-
form
$MYSQLD_DATADIR
/
master
-
bin
.
00000
1
|
$MYSQL
--
default
-
character
-
set
=
utf8
# original and recovered data must be equal
select
HEX
(
f
)
from
t03
;
select
HEX
(
f
)
from
t3
;
...
...
mysql-test/t/ps_not_windows.test
View file @
bdd43744
...
...
@@ -2,6 +2,8 @@
--
source
include
/
not_embedded
.
inc
# Non-windows specific ps tests.
--
source
include
/
not_windows
.
inc
# requires dynamic loading
--
source
include
/
have_dynamic_loading
.
inc
#
# Bug #20665: All commands supported in Stored Procedures should work in
...
...
mysql-test/t/sp.test
View file @
bdd43744
...
...
@@ -8242,6 +8242,28 @@ while ($tab_count)
DROP PROCEDURE p1;
DROP TABLE t1;
--echo #
--echo # Bug #46629: Item_in_subselect::val_int(): Assertion `
0
'
--
echo
# on subquery inside a SP
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t2
(
a
INT
,
b
INT
PRIMARY
KEY
);
DELIMITER
|
;
CREATE
PROCEDURE
p1
()
BEGIN
SELECT
a
FROM
t1
A
WHERE
A
.
b
IN
(
SELECT
b
FROM
t2
AS
B
);
END
|
DELIMITER
;
|
--
error
ER_BAD_FIELD_ERROR
CALL
p1
;
--
error
ER_BAD_FIELD_ERROR
CALL
p1
;
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
,
t2
;
--
echo
# ------------------------------------------------------------------
--
echo
# -- End of 5.1 tests
--
echo
# ------------------------------------------------------------------
mysys/my_copy.c
View file @
bdd43744
...
...
@@ -88,6 +88,13 @@ int my_copy(const char *from, const char *to, myf MyFlags)
goto
err
;
}
/* sync the destination file */
if
(
MyFlags
&
MY_SYNC
)
{
if
(
my_sync
(
to_file
,
MyFlags
))
goto
err
;
}
if
(
my_close
(
from_file
,
MyFlags
)
|
my_close
(
to_file
,
MyFlags
))
DBUG_RETURN
(
-
1
);
/* Error on close */
...
...
sql/ha_partition.cc
View file @
bdd43744
...
...
@@ -3025,7 +3025,7 @@ int ha_partition::write_row(uchar * buf)
tmp_disable_binlog
(
thd
);
/* Do not replicate the low-level changes. */
error
=
m_file
[
part_id
]
->
ha_write_row
(
buf
);
if
(
have_auto_increment
&&
!
table
->
s
->
next_number_keypart
)
set_auto_increment_if_higher
(
table
->
next_number_field
->
val_int
()
);
set_auto_increment_if_higher
(
table
->
next_number_field
);
reenable_binlog
(
thd
);
exit:
table
->
timestamp_field_type
=
orig_timestamp_type
;
...
...
@@ -3129,7 +3129,7 @@ exit:
HA_DATA_PARTITION
*
ha_data
=
(
HA_DATA_PARTITION
*
)
table_share
->
ha_data
;
if
(
!
ha_data
->
auto_inc_initialized
)
info
(
HA_STATUS_AUTO
);
set_auto_increment_if_higher
(
table
->
found_next_number_field
->
val_int
()
);
set_auto_increment_if_higher
(
table
->
found_next_number_field
);
}
table
->
timestamp_field_type
=
orig_timestamp_type
;
DBUG_RETURN
(
error
);
...
...
sql/ha_partition.h
View file @
bdd43744
...
...
@@ -936,9 +936,11 @@ private:
auto_increment_lock
=
FALSE
;
}
}
virtual
void
set_auto_increment_if_higher
(
const
ulonglong
nr
)
virtual
void
set_auto_increment_if_higher
(
Field
*
field
)
{
HA_DATA_PARTITION
*
ha_data
=
(
HA_DATA_PARTITION
*
)
table_share
->
ha_data
;
ulonglong
nr
=
(((
Field_num
*
)
field
)
->
unsigned_flag
||
field
->
val_int
()
>
0
)
?
field
->
val_int
()
:
0
;
lock_auto_increment
();
DBUG_ASSERT
(
ha_data
->
auto_inc_initialized
==
TRUE
);
/* must check when the mutex is taken */
...
...
sql/item_subselect.cc
View file @
bdd43744
...
...
@@ -155,13 +155,11 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
uchar
*
)
&
res
))
return
TRUE
;
res
=
engine
->
prepare
();
// all transformation is done (used by prepared statements)
changed
=
1
;
if
(
!
res
)
if
(
!
(
res
=
engine
->
prepare
()))
{
// all transformation is done (used by prepared statements)
changed
=
1
;
if
(
substitution
)
{
int
ret
=
0
;
...
...
sql/sql_insert.cc
View file @
bdd43744
...
...
@@ -3596,7 +3596,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
DBUG_EXECUTE_IF
(
"sleep_create_select_before_check_if_exists"
,
my_sleep
(
6000000
););
if
(
!
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
)
&&
create_table
->
table
->
db_stat
)
(
create_table
->
table
&&
create_table
->
table
->
db_stat
)
)
{
/* Table already exists and was open at open_and_lock_tables() stage. */
if
(
create_info
->
options
&
HA_LEX_CREATE_IF_NOT_EXISTS
)
...
...
sql/sql_select.cc
View file @
bdd43744
...
...
@@ -2252,7 +2252,7 @@ JOIN::destroy()
tab
->
cleanup
();
}
tmp_join
->
tmp_join
=
0
;
tmp_table_param
.
c
opy_field
=
0
;
tmp_table_param
.
c
leanup
()
;
DBUG_RETURN
(
tmp_join
->
destroy
());
}
cond_equal
=
0
;
...
...
sql/sql_table.cc
View file @
bdd43744
...
...
@@ -5217,6 +5217,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
char
tmp_path
[
FN_REFLEN
];
#endif
char
ts_name
[
FN_LEN
+
1
];
myf
flags
=
MY_DONT_OVERWRITE_FILE
;
DBUG_ENTER
(
"mysql_create_like_table"
);
...
...
@@ -5273,8 +5274,12 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
DBUG_EXECUTE_IF
(
"sleep_create_like_before_copy"
,
my_sleep
(
6000000
););
if
(
opt_sync_frm
&&
!
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
))
flags
|=
MY_SYNC
;
/*
Create a new table by copying from source table
and sync the new table if the flag MY_SYNC is set
Altough exclusive name-lock on target table protects us from concurrent
DML and DDL operations on it we still want to wrap .FRM creation and call
...
...
@@ -5295,7 +5300,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
goto
err
;
}
}
else
if
(
my_copy
(
src_path
,
dst_path
,
MYF
(
MY_DONT_OVERWRITE_FILE
)
))
else
if
(
my_copy
(
src_path
,
dst_path
,
flags
))
{
if
(
my_errno
==
ENOENT
)
my_error
(
ER_BAD_DB_ERROR
,
MYF
(
0
),
db
);
...
...
storage/myisam/myisamchk.c
View file @
bdd43744
...
...
@@ -302,17 +302,17 @@ static struct my_option my_long_options[] =
(
uchar
**
)
&
check_param
.
read_buffer_length
,
(
uchar
**
)
&
check_param
.
read_buffer_length
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
(
long
)
READ_BUFFER_INIT
,
(
long
)
MALLOC_OVERHEAD
,
(
long
)
~
0L
,
(
long
)
MALLOC_OVERHEAD
,
(
long
)
1L
,
0
},
INT_MAX32
,
(
long
)
MALLOC_OVERHEAD
,
(
long
)
1L
,
0
},
{
"write_buffer_size"
,
OPT_WRITE_BUFFER_SIZE
,
""
,
(
uchar
**
)
&
check_param
.
write_buffer_length
,
(
uchar
**
)
&
check_param
.
write_buffer_length
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
(
long
)
READ_BUFFER_INIT
,
(
long
)
MALLOC_OVERHEAD
,
(
long
)
~
0L
,
(
long
)
MALLOC_OVERHEAD
,
(
long
)
1L
,
0
},
INT_MAX32
,
(
long
)
MALLOC_OVERHEAD
,
(
long
)
1L
,
0
},
{
"sort_buffer_size"
,
OPT_SORT_BUFFER_SIZE
,
""
,
(
uchar
**
)
&
check_param
.
sort_buffer_length
,
(
uchar
**
)
&
check_param
.
sort_buffer_length
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
(
long
)
SORT_BUFFER_INIT
,
(
long
)
(
MIN_SORT_BUFFER
+
MALLOC_OVERHEAD
),
(
long
)
~
0L
,
(
long
)
MALLOC_OVERHEAD
,
(
long
)
1L
,
0
},
ULONG_MAX
,
(
long
)
MALLOC_OVERHEAD
,
(
long
)
1L
,
0
},
{
"sort_key_blocks"
,
OPT_SORT_KEY_BLOCKS
,
""
,
(
uchar
**
)
&
check_param
.
sort_key_blocks
,
(
uchar
**
)
&
check_param
.
sort_key_blocks
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment