Commit 4aa9d903 authored by Michael Widenius's avatar Michael Widenius

Merge with MySQL 5.1.47

Fixed some bugs introduced in 5.1.47
Disabled some tests until we have merged with latest Xtradb

configure.in:
  Added testing if valgrind/memcheck.h exists
storage/pbxt/src/ha_pbxt.cc:
  LOCK_plugin is not anymore locked in init
parents 9febcb47 af6d89a6
......@@ -12,7 +12,7 @@ dnl
dnl When changing the major version number please also check the switch
dnl statement in mysqlbinlog::check_master_version(). You may also need
dnl to update version.c in ndb.
AC_INIT([MariaDB Server], [5.1.46-MariaDB], [], [mysql])
AC_INIT([MariaDB Server], [5.1.47-MariaDB], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM
......@@ -831,7 +831,7 @@ AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \
memory.h pwd.h select.h fnmatch.h \
stdlib.h stddef.h sys/stat.h \
stdlib.h stddef.h sys/stat.h valgrind/memcheck.h \
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
......
......@@ -772,7 +772,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
#define MY_NFILE 64 /* This is only used to save filenames */
#ifndef OS_FILE_LIMIT
#define OS_FILE_LIMIT 65535
#define OS_FILE_LIMIT UINT_MAX
#endif
/* #define EXT_IN_LIBNAME */
......
......@@ -145,7 +145,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C)
#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C)
#define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C)
#define TRASH(A,B) bfill(A, B, 0x8F)
#define QUICK_SAFEMALLOC sf_malloc_quick=1
#define NORMAL_SAFEMALLOC sf_malloc_quick=0
extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
......
......@@ -807,30 +807,37 @@ void mysql_query_cache_invalidate4(MYSQL_THD thd,
const char *key, unsigned int key_length,
int using_trx);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
/**
Provide a handler data getter to simplify coding
*/
inline
void *
thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
{
return *thd_ha_data(thd, hton);
}
void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
/**
Provide a handler data setter to simplify coding
@details
Set ha_data pointer (storage engine per-connection information).
To avoid unclean deactivation (uninstall) of storage engine plugin
in the middle of transaction, additional storage engine plugin
lock is acquired.
If ha_data is not null and storage engine plugin was not locked
by thd_set_ha_data() in this connection before, storage engine
plugin gets locked.
If ha_data is null and storage engine plugin was locked by
thd_set_ha_data() in this connection before, storage engine
plugin lock gets released.
If handlerton::close_connection() didn't reset ha_data, server does
it immediately after calling handlerton::close_connection().
*/
inline
void
thd_set_ha_data(const MYSQL_THD thd, const struct handlerton *hton,
const void *ha_data)
{
*thd_ha_data(thd, hton)= (void*) ha_data;
void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
const void *ha_data);
#ifdef __cplusplus
}
#endif
......
......@@ -139,3 +139,6 @@ void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
const char *key, unsigned int key_length,
int using_trx);
void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
void thd_set_ha_data(void* thd, const struct handlerton *hton,
const void *ha_data);
disable_query_log;
--require r/true.require
SELECT (plugin_library LIKE 'ha_innodb_plugin%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
enable_query_log;
......@@ -193,6 +193,8 @@ INSERT INTO global_suppressions VALUES
("==[0-9]*== For more details"),
/* This comes with innodb plugin tests */
("==[0-9]*== Warning: set address range perms: large range"),
/* valgrind-3.5.0 dumps this */
("==[0-9]*== Command: "),
/* valgrind warnings: invalid file descriptor -1 in syscall
write()/read(). Bug #50414 */
......
......@@ -70,11 +70,20 @@ my $skip_test_reg;
# Related to adding InnoDB plugin combinations
my $lib_innodb_plugin;
my $do_innodb_plugin;
# If "Quick collect", set to 1 once a test to run has been found.
my $some_test_found;
sub find_innodb_plugin {
$lib_innodb_plugin=
my_find_file($::basedir,
["storage/innodb_plugin", "storage/innodb_plugin/.libs",
"lib/mysql/plugin", "lib/mariadb/plugin", "lib/plugin"],
["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
"ha_innodb_plugin.sl"],
NOT_REQUIRED);
}
sub init_pattern {
my ($from, $what)= @_;
return undef unless defined $from;
......@@ -107,16 +116,7 @@ sub collect_test_cases ($$$) {
$do_test_reg= init_pattern($do_test, "--do-test");
$skip_test_reg= init_pattern($skip_test, "--skip-test");
$lib_innodb_plugin=
my_find_file($::basedir,
["storage/innodb_plugin", "storage/innodb_plugin/.libs",
"lib/mysql/plugin", "lib/mariadb/plugin", "lib/plugin"],
["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
"ha_innodb_plugin.sl"],
NOT_REQUIRED);
$do_innodb_plugin= ($::mysql_version_id >= 50100 &&
!(IS_WINDOWS && $::opt_embedded_server) &&
$lib_innodb_plugin);
&find_innodb_plugin;
# If not reordering, we also shouldn't group by suites, unless
# no test cases were named.
......@@ -508,73 +508,6 @@ sub collect_one_suite
}
}
# ----------------------------------------------------------------------
# Testing InnoDB plugin.
# ----------------------------------------------------------------------
if ($do_innodb_plugin)
{
my @new_cases;
my $sep= (IS_WINDOWS) ? ';' : ':';
foreach my $test (@cases)
{
next if (!$test->{'innodb_test'});
# If skipped due to no builtin innodb, we can still run it with plugin
next if ($test->{'skip'} && $test->{comment} ne "No innodb support");
# Exceptions
next if ($test->{'name'} eq 'main.innodb'); # Failed with wrong errno (fk)
next if ($test->{'name'} eq 'main.index_merge_innodb'); # Explain diff
# innodb_file_per_table is rw with innodb_plugin
next if ($test->{'name'} eq 'sys_vars.innodb_file_per_table_basic');
# innodb_lock_wait_timeout is rw with innodb_plugin
next if ($test->{'name'} eq 'sys_vars.innodb_lock_wait_timeout_basic');
# Diff around innodb_thread_concurrency variable
next if ($test->{'name'} eq 'sys_vars.innodb_thread_concurrency_basic');
# Can't work with InnoPlug. Test framework needs to be re-designed.
next if ($test->{'name'} eq 'main.innodb_bug46000');
# Fails with innodb plugin
next if ($test->{'name'} eq 'main.innodb-autoinc');
# Fails with innodb plugin: r6185 Testcases changes not included
next if ($test->{'name'} eq 'main.innodb_bug44369');
# Fix for BUG47621 is not in InnoDB plugin
next if ($test->{'name'} eq 'main.innodb_bug21704');
next if ($test->{'name'} eq 'main.innodb_bug47621');
# Copy test options
my $new_test= My::Test->new();
while (my ($key, $value) = each(%$test))
{
if (ref $value eq "ARRAY")
{
push(@{$new_test->{$key}}, @$value);
}
else
{
$new_test->{$key}= $value unless ($key eq 'skip');
}
}
my $plugin_filename= basename($lib_innodb_plugin);
my $plugin_list= "innodb=$plugin_filename" . $sep . "innodb_locks=$plugin_filename";
push(@{$new_test->{master_opt}}, '--ignore-builtin-innodb');
push(@{$new_test->{master_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
push(@{$new_test->{master_opt}}, "--plugin_load=$plugin_list");
push(@{$new_test->{slave_opt}}, '--ignore-builtin-innodb');
push(@{$new_test->{slave_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
push(@{$new_test->{slave_opt}}, "--plugin_load=$plugin_list");
if ($new_test->{combination})
{
$new_test->{combination}.= '+innodb_plugin';
}
else
{
$new_test->{combination}= 'innodb_plugin';
}
push(@new_cases, $new_test);
}
push(@cases, @new_cases);
}
# ----------------------------------------------------------------------
# End of testing InnoDB plugin.
# ----------------------------------------------------------------------
optimize_cases(\@cases);
#print_testcases(@cases);
......@@ -1029,11 +962,38 @@ sub collect_one_test_case {
{
# innodb is not supported, skip it
$tinfo->{'skip'}= 1;
# This comment is checked for running with innodb plugin (see above),
# please keep that in mind if changing the text.
$tinfo->{'comment'}= "No innodb support";
# But continue processing if we may run it with innodb plugin
return $tinfo unless $do_innodb_plugin;
return $tinfo;
}
}
elsif ( $tinfo->{'innodb_plugin_test'} )
{
# This is a test that needs the innodb plugin
if (!&find_innodb_plugin)
{
# innodb plugin is not supported, skip it
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "No innodb plugin support";
return $tinfo;
}
my $sep= (IS_WINDOWS) ? ';' : ':';
my $plugin_filename= basename($lib_innodb_plugin);
my $plugin_list=
"innodb=$plugin_filename$sep" .
"innodb_trx=$plugin_filename$sep" .
"innodb_locks=$plugin_filename$sep" .
"innodb_lock_waits=$plugin_filename$sep" .
"innodb_cmp=$plugin_filename$sep" .
"innodb_cmp_reset=$plugin_filename$sep" .
"innodb_cmpmem=$plugin_filename$sep" .
"innodb_cmpmem_reset=$plugin_filename";
foreach my $k ('master_opt', 'slave_opt')
{
push(@{$tinfo->{$k}}, '--ignore-builtin-innodb');
push(@{$tinfo->{$k}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
push(@{$tinfo->{$k}}, "--plugin-load=$plugin_list");
}
}
else
......@@ -1205,6 +1165,7 @@ my @tags=
["include/have_innodb.inc", "innodb_test", 1],
["include/have_pbxt.inc", "pbxt_test", 1],
["include/have_innodb_plugin.inc", "innodb_plugin_test", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
......
......@@ -1592,6 +1592,8 @@ sub collect_mysqld_features {
my $cmd= join(" ", $exe_mysqld, @$args);
my $list= `$cmd`;
print "cmd: $cmd\n";
foreach my $line (split('\n', $list))
{
# First look for version
......
#
# Bug#46261 Plugins can be installed with --skip-grant-tables
#
INSTALL PLUGIN example SONAME 'ha_example.so';
ERROR HY000: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
UNINSTALL PLUGIN example;
ERROR HY000: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
End of 5.1 tests
......@@ -1230,6 +1230,14 @@ SELECT HEX(DAYNAME(19700101));
HEX(DAYNAME(19700101))
0427043504420432043504400433
SET character_set_connection=latin1;
#
# Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817
#
CREATE TABLE t1 (a CHAR(1) CHARSET ascii, b CHAR(1) CHARSET latin1);
CREATE VIEW v1 AS SELECT 1 from t1
WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP VIEW v1;
DROP TABLE t1;
End of 5.0 tests
Start of 5.1 tests
SET NAMES utf8;
......
......@@ -18,3 +18,26 @@ SELECT MAX(a) FROM t1 GROUP BY a,b;
ERROR 23000: Can't write; duplicate key in table 'tmp_table'
set tmp_table_size=default;
DROP TABLE t1;
#
# Bug #50946: fast index creation still seems to copy the table
#
CREATE TABLE t1 (a INT(100) NOT NULL);
INSERT INTO t1 VALUES (1), (0), (2);
SET SESSION debug='+d,alter_table_only_index_change';
ALTER TABLE t1 ADD INDEX a(a);
SET SESSION debug=DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(100) NOT NULL,
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t1;
a
0
1
2
DROP TABLE t1;
#
# End of 5.1 tests
#
......@@ -226,4 +226,16 @@ Warnings:
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
Note 1003 select (select 1 from `test`.`t2` where (`test`.`t2`.`d` = NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
DROP TABLE t1, t2;
#
# Bug #48419: another explain crash..
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b BLOB, KEY b(b(100)));
INSERT INTO t2 VALUES ('1'), ('2'), ('3');
FLUSH TABLES;
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT 1 FROM t1 t JOIN t2 WHERE b <= 1 AND t.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t1, t2;
End of 5.1 tests.
......@@ -2358,4 +2358,32 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
drop table t1,t2;
#
# Bug #47453: InnoDB incorrectly changes TIMESTAMP columns when
# JOINed during an UPDATE
#
CREATE TABLE t1 (d INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT, b INT,
c TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP) ENGINE=InnoDB;
set up our data elements
INSERT INTO t1 (d) VALUES (1);
INSERT INTO t2 (a,b) VALUES (1,1);
SELECT SECOND(c) INTO @bug47453 FROM t2;
SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a;
SECOND(c)-@bug47453
0
UPDATE t1 JOIN t2 ON d=a SET b=1 WHERE a=1;
SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a;
SECOND(c)-@bug47453
0
SELECT SLEEP(1);
SLEEP(1)
0
UPDATE t1 JOIN t2 ON d=a SET b=1 WHERE a=1;
#should be 0
SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a;
SECOND(c)-@bug47453
0
DROP TABLE t1, t2;
End of 5.1 tests
......@@ -1146,6 +1146,16 @@ ROW(t1.b, 1111.11) <=> ROW('','');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t1;
#
# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
#
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES (0,0), (1,1);
SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
a b a b
0 0 0 0
1 1 1 1
DROP TABLE t1;
End of 5.0 tests.
CREATE TABLE t1 (f1 int);
CREATE TABLE t2 (f1 int);
......@@ -1174,14 +1184,4 @@ NULL
NULL
1
DROP TABLE t1, t2, mm1;
#
# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
#
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES (0,0), (1,1);
SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
a b a b
0 0 0 0
1 1 1 1
DROP TABLE t1;
End of 5.1 tests
......@@ -202,12 +202,6 @@ select * from t1;
a b c
10 NULL Ten
15 NULL Fifteen
show variables like "secure_file_pri%";
Variable_name Value
secure_file_priv MYSQLTEST_VARDIR/
select @@secure_file_priv;
@@secure_file_priv
MYSQLTEST_VARDIR/
set @@secure_file_priv= 0;
ERROR HY000: Variable 'secure_file_priv' is a read only variable
truncate table t1;
......
......@@ -155,24 +155,24 @@ execute stmt1 ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
execute stmt1 ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
deallocate prepare stmt1;
......@@ -2988,4 +2988,17 @@ select @plaintext;
bcd
deallocate prepare encode;
deallocate prepare decode;
#
# Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings
#
CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT);
INSERT INTO t1 VALUES (0, 0),(0, 0);
PREPARE stmt FROM "SELECT 1 FROM t1 WHERE
ROW(a, b) >= ROW('1', (SELECT 1 FROM t1 WHERE a > 1234))";
EXECUTE stmt;
1
EXECUTE stmt;
1
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests.
......@@ -457,3 +457,12 @@ abc 1 abc 1
select host,user from mysql.user where (host,user) = ('localhost','test');
host user
drop table t1,t2;
#
# Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings
#
CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT);
INSERT INTO t1 VALUES (0, 0),(0, 0);
SELECT 1 FROM t1 WHERE ROW(a, b) >=
ROW('1', (SELECT 1 FROM t1 WHERE a > 1234));
1
DROP TABLE t1;
......@@ -2101,4 +2101,27 @@ Warning 1048 Column 'id' cannot be null
Warning 1048 Column 'id' cannot be null
DROP TRIGGER t1_bu;
DROP TABLE t1,t2;
#
# Bug#50755: Crash if stored routine def contains version comments
#
DROP DATABASE IF EXISTS db1;
DROP TRIGGER IF EXISTS trg1;
DROP TABLE IF EXISTS t1, t2;
CREATE DATABASE db1;
USE db1;
CREATE TABLE t1 (b INT);
CREATE TABLE t2 (a INT);
CREATE TRIGGER trg1 BEFORE INSERT ON t2 FOR EACH ROW INSERT/*!INTO*/t1 VALUES (1);
# Used to crash
SHOW TRIGGERS IN db1;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
Warnings:
Warning 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1
INSERT INTO t2 VALUES (1);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1
SELECT * FROM t1;
b
# Work around Bug#45235
DROP DATABASE db1;
USE test;
End of 5.1 tests.
......@@ -10,3 +10,16 @@ set debug= '-P';
select @@debug;
@@debug
T
#
# Bug #52629: memory leak from sys_var_thd_dbug in
# binlog.binlog_write_error
#
SET GLOBAL debug='d,injecting_fault_writing';
SELECT @@global.debug;
@@global.debug
d,injecting_fault_writing
SET GLOBAL debug='';
SELECT @@global.debug;
@@global.debug
End of 5.1 tests
......@@ -3874,6 +3874,14 @@ CREATE VIEW v1 AS SELECT 1 FROM t1 WHERE
ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' )));
DROP VIEW v1;
DROP TABLE t1;
#
# Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817
#
CREATE TABLE t1 (a CHAR(1) CHARSET latin1, b CHAR(1) CHARSET utf8);
CREATE VIEW v1 AS SELECT 1 from t1
WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP VIEW v1;
DROP TABLE t1;
# -----------------------------------------------------------------
# -- End of 5.1 tests.
# -----------------------------------------------------------------
......@@ -202,7 +202,7 @@ eval kill query $ID;
rollback;
connection con2;
--error 0,ER_QUERY_INTERRUPTED
--error 0,ER_QUERY_INTERRUPTED,ER_LOCK_WAIT_TIMEOUT
reap;
# todo 1,2 above
rollback;
......
......@@ -50,22 +50,22 @@ The following suites are included:
Known Issues
------------
1) The 'funcs' and 'iuds' suites currently runs only against MySQL 5.1 server.
Running them against MySQL 5.5 will generate errors.
2) The folowing tests in the 'iuds' suite:
1) The folowing tests in the 'iuds' suite:
- delete_decimal
- insert_decimal
- update_decimal
will return a 'Warning 1264 - Out of range value...' warning if run in a 32-bit environment.
Add the '--force' option to prevent the test run from aborting.
3) The following tests in the 'funcs' suite will fail when run against the innodb_plugin:
2) The following tests in the 'funcs' suite will fail when run against the innodb_plugin:
- crash_manycolumns_string (bug 50495)
- ix_unique_lob (bug 52056, masked by an 'Out of memory error' on some 32-bit platforms)
- ix_unique_string_length (bug 52056, masked by an 'Out of memory error' on some 32-bit platforms)
Add the '--force' option to prevent the test run from aborting.
4) Some of the rpl_xxx tests in the 'funcs' suite require a secific binlog_forat setting and will be
3) Some of the rpl_xxx tests in the 'funcs' suite require a secific binlog_forat setting and will be
skipped otherwise.
4) Some of the rpl_xxx tests in the 'funcs' suite will report a 'Statement unsafe for replication' warning
when run againsr a server configured to use statement based replication.
# List of disabled tests
# test name : comment
#rpl_redirect : Fails due to bug#49978
rpl_redirect : Fails due to bug#49978
crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works for built-in innodb
ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
......@@ -986,7 +986,7 @@ c1 c2 c3 c4
2155 2155 1998-12-26 1998-12-26 11:30:45
SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2;
total_rows min_value max(c2)
20 1901 2155
20 0 2155
SELECT * FROM t2 WHERE c3 = '1998-12-11';
c1 c2 c3 c4
1990 1990 1998-12-11 1998-12-11 11:30:45
......@@ -1400,7 +1400,7 @@ c1 c2 c3 c4
2155 2155 1998-12-26 1998-12-26 11:30:45
SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2;
total_rows min_value max(c2)
20 1901 2155
20 0 2155
SELECT * FROM t2 WHERE c3 = '1998-12-11';
c1 c2 c3 c4
1990 1990 1998-12-11 1998-12-11 11:30:45
......
......@@ -791,9 +791,6 @@ Warning 1292 Truncated incorrect datetime value: '2009-01-10 23:60:59'
SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */;
count(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1
Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1
SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00';
c1 c2 c3
0000-00-00 00:00:00 0000-00-00 00:00:00 6
......
insert_calendar : Bug #52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
......@@ -7812,10 +7812,15 @@ SELECT * FROM t2 ORDER BY c1,c6 LIMIT 2;
SELECT * FROM t2 ORDER BY c1,c6 DESC LIMIT 2;
## ref type access
# Bug#52283 : Remove the following --disable_warnings
# command when the bug is fixed
--disable_warnings
SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6;
SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6 LIMIT 2;
SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6 DESC;
SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6 DESC LIMIT 2;
--enable_warnings
## Range access, ordered ##
SELECT * FROM t2 WHERE c1 <> 18446744073709551616 ORDER BY c1,c6;
......
......@@ -300,7 +300,12 @@ INSERT INTO t1 VALUES('2001-01-09','2001-01-10',6),('2001-01-11','2001-01-12',7)
UPDATE t1 SET c1='2001-01-09 24:59:59',c2='2009-01-10 23:60:59' WHERE c1='2001-01-09';
UPDATE t1 SET c2='2001-01-11 23:59:60' WHERE c1='2001-01-11';
SELECT count(*) FROM t1 WHERE c1='2001-01-09 24:59:59' AND c2='2009-01-10 23:60:59';
# Bug#52283 : Remove the following --disable_warnings
# command when the bug is fixed
--disable_warnings
SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */;
--enable_warnings
--sorted_result
SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00';
......
disable_query_log;
--require r/true.require
select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
enable_query_log;
create table bug44369 (DB_ROW_ID int) engine=innodb;
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
ERROR 42000: Incorrect column name 'DB_ROW_ID'
show warnings;
Level Code Message
Error 1166 Incorrect column name 'DB_ROW_ID'
Error 1005 Can't create table 'test.bug44369' (errno: -1)
create table bug44369 (db_row_id int) engine=innodb;
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
show errors;
ERROR 42000: Incorrect column name 'db_row_id'
show warnings;
Level Code Message
Error 1005 Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
Error 1166 Incorrect column name 'db_row_id'
Error 1005 Can't create table 'test.bug44369' (errno: -1)
create table bug44369 (db_TRX_Id int) engine=innodb;
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
show errors;
ERROR 42000: Incorrect column name 'db_TRX_Id'
show warnings;
Level Code Message
Error 1005 Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
Error 1166 Incorrect column name 'db_TRX_Id'
Error 1005 Can't create table 'test.bug44369' (errno: -1)
CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
INSERT INTO bug51920 VALUES (1);
BEGIN;
SELECT * FROM bug51920 FOR UPDATE;
i
1
UPDATE bug51920 SET i=2;
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE INFO="UPDATE bug51920 SET i=2"
INTO @thread_id;
KILL @thread_id;
Got one of the listed errors
DROP TABLE bug51920;
set session transaction isolation level read committed;
create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
(what, id)) engine=innodb;
insert into innodb_bug52663 values ('total', 0, 0);
begin;
set session transaction isolation level read committed;
begin;
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
select * from innodb_bug52663;
what id count
total 0 1
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from innodb_bug52663;
what id count
total 0 0
commit;
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
commit;
select * from innodb_bug52663;
what id count
total 0 2
select * from innodb_bug52663;
what id count
total 0 2
drop table innodb_bug52663;
This diff is collapsed.
innodb-index: InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal
##############################################################################
#
# List the test cases that are to be disabled temporarily.
#
# Separate the test case name and the comment with ':'.
#
# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
#
# Do not use any TAB characters for whitespace.
#
##############################################################################
innodb : Bug#53306 2010-04-30 VasilDimov valgrind warnings
innodb_bug52663 : Waiting for merge with XtraDB
innodb_bug51920 : Waiting for merge with XtraDB
innodb-autoinc : Automatic file format change to Barracuda
#
# Test that mysqld does not crash when running ANALYZE TABLE with
# different values of the parameter innodb_stats_sample_pages.
#
-- source include/have_innodb.inc
-- source suite/innodb/include/have_innodb_plugin.inc
# we care only that the following SQL commands do not produce errors
# and do not crash the server
-- disable_query_log
-- disable_result_log
-- enable_warnings
SET GLOBAL innodb_stats_sample_pages=0;
# check that the value has been adjusted to 1
-- enable_result_log
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
-- disable_result_log
CREATE TABLE innodb_analyze (
a INT,
b INT,
KEY(a),
KEY(b,a)
) ENGINE=InnoDB;
# test with empty table
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=2;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=4;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=16;
ANALYZE TABLE innodb_analyze;
INSERT INTO innodb_analyze VALUES
(1,1), (1,1), (1,2), (1,3), (1,4), (1,5),
(8,1), (8,8), (8,2), (7,1), (1,4), (3,5);
SET GLOBAL innodb_stats_sample_pages=1;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=2;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=4;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8;
ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=16;
ANALYZE TABLE innodb_analyze;
DROP TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=DEFAULT;
......@@ -478,23 +478,187 @@ INSERT INTO t2 SELECT c1 FROM t1;
INSERT INTO t2 SELECT NULL FROM t1;
DROP TABLE t1;
DROP TABLE t2;
# If the user has specified negative values for an AUTOINC column then
# InnoDB should ignore those values when setting the table's max value.
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SHOW VARIABLES LIKE "%auto_inc%";
# TINYINT
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-127, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-127, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
#
# SMALLINT
#
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-32767, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-32757, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
#
# MEDIUMINT
#
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-8388607, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-8388607, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
#
# INT
#
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-2147483647, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-2147483647, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
#
# BIGINT
#
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (-1, 'innodb');
INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
INSERT INTO t1 VALUES (NULL, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
#
# End negative number check
##
# 47125: auto_increment start value is ignored if an index is created
# and engine=innodb
#
# 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from
# the index (PRIMARY)
# This test requires a restart of the server
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (null);
INSERT INTO t1 VALUES (null);
ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
CREATE INDEX i1 on t1(c2);
SHOW CREATE TABLE t1;
INSERT INTO t1 (c2) values (0);
SELECT * FROM t1;
DROP TABLE t1;
##
# 49032: Use the correct function to read the AUTOINC column value
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
# Restart the server
-- source include/restart_mysqld.inc
# The MySQL and InnoDB data dictionaries should now be out of sync.
# The select should print message to the error log
INSERT INTO t1(C2) VALUES ('innodb');
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
# Restart the server
-- source include/restart_mysqld.inc
INSERT INTO t1(C2) VALUES ('innodb');
SHOW CREATE TABLE t1;
DROP TABLE t1;
##
# 47720: REPLACE INTO Autoincrement column with negative values
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 SET c1 = 1;
SHOW CREATE TABLE t1;
INSERT INTO t1 SET c1 = 2;
INSERT INTO t1 SET c1 = -1;
SELECT * FROM t1;
-- error ER_AUTOINC_READ_FAILED,1467
INSERT INTO t1 VALUES(null);
ALTER TABLE t1 AUTO_INCREMENT = 3;
INSERT INTO t1 VALUES(null);
-- error ER_DUP_ENTRY,1062
INSERT INTO t1 SET c1 = -1;
SHOW CREATE TABLE t1;
REPLACE INTO t1 VALUES (-1);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
##
# 49497: Error 1467 (ER_AUTOINC_READ_FAILED) on inserting a negative value
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL);
INSERT INTO t1 VALUES (4), (5), (6), (NULL);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
-- source include/have_innodb.inc
-- source suite/innodb/include/have_innodb_plugin.inc
let $timeout=`select @@innodb_lock_wait_timeout`;
set global innodb_lock_wait_timeout=42;
connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
select @@innodb_lock_wait_timeout;
set innodb_lock_wait_timeout=1;
select @@innodb_lock_wait_timeout;
connection b;
select @@innodb_lock_wait_timeout;
set global innodb_lock_wait_timeout=347;
select @@innodb_lock_wait_timeout;
set innodb_lock_wait_timeout=1;
select @@innodb_lock_wait_timeout;
connect (c,localhost,root,,);
connection c;
select @@innodb_lock_wait_timeout;
connection default;
disconnect c;
connection a;
create table t1(a int primary key)engine=innodb;
begin;
insert into t1 values(1),(2),(3);
connection b;
--send
select * from t1 for update;
connection a;
commit;
connection b;
reap;
connection a;
begin;
insert into t1 values(4);
connection b;
--send
select * from t1 for update;
connection a;
sleep 2;
commit;
connection b;
--error ER_LOCK_WAIT_TIMEOUT
reap;
drop table t1;
connection default;
disconnect a;
disconnect b;
eval set global innodb_lock_wait_timeout=$timeout;
--loose-innodb-use-sys-malloc=true
--loose-innodb-use-sys-malloc=true
--source include/have_innodb.inc
-- source suite/innodb/include/have_innodb_plugin.inc
# XtraDB has lots of "still reachable" memory leak warnings at shutdown when
# --innodb-use-sys-malloc
--source include/not_valgrind.inc
......
This diff is collapsed.
#
# Test case for bug 36172
#
-- source include/not_embedded.inc
-- source include/have_innodb.inc
-- source suite/innodb/include/have_innodb_plugin.inc
SET storage_engine=InnoDB;
# we do not really care about what gets printed, we are only
# interested in getting success or failure according to our
# expectations
-- disable_query_log
-- disable_result_log
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on;
DROP TABLE IF EXISTS `table0`;
CREATE TABLE `table0` ( `col0` tinyint(1) DEFAULT NULL, `col1` tinyint(1) DEFAULT NULL, `col2` tinyint(4) DEFAULT NULL, `col3` date DEFAULT NULL, `col4` time DEFAULT NULL, `col5` set('test1','test2','test3') DEFAULT NULL, `col6` time DEFAULT NULL, `col7` text, `col8` decimal(10,0) DEFAULT NULL, `col9` set('test1','test2','test3') DEFAULT NULL, `col10` float DEFAULT NULL, `col11` double DEFAULT NULL, `col12` enum('test1','test2','test3') DEFAULT NULL, `col13` tinyblob, `col14` year(4) DEFAULT NULL, `col15` set('test1','test2','test3') DEFAULT NULL, `col16` decimal(10,0) DEFAULT NULL, `col17` decimal(10,0) DEFAULT NULL, `col18` blob, `col19` datetime DEFAULT NULL, `col20` double DEFAULT NULL, `col21` decimal(10,0) DEFAULT NULL, `col22` datetime DEFAULT NULL, `col23` decimal(10,0) DEFAULT NULL, `col24` decimal(10,0) DEFAULT NULL, `col25` longtext, `col26` tinyblob, `col27` time DEFAULT NULL, `col28` tinyblob, `col29` enum('test1','test2','test3') DEFAULT NULL, `col30` smallint(6) DEFAULT NULL, `col31` double DEFAULT NULL, `col32` float DEFAULT NULL, `col33` char(175) DEFAULT NULL, `col34` tinytext, `col35` tinytext, `col36` tinyblob, `col37` tinyblob, `col38` tinytext, `col39` mediumblob, `col40` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col41` double DEFAULT NULL, `col42` smallint(6) DEFAULT NULL, `col43` longblob, `col44` varchar(80) DEFAULT NULL, `col45` mediumtext, `col46` decimal(10,0) DEFAULT NULL, `col47` bigint(20) DEFAULT NULL, `col48` date DEFAULT NULL, `col49` tinyblob, `col50` date DEFAULT NULL, `col51` tinyint(1) DEFAULT NULL, `col52` mediumint(9) DEFAULT NULL, `col53` float DEFAULT NULL, `col54` tinyblob, `col55` longtext, `col56` smallint(6) DEFAULT NULL, `col57` enum('test1','test2','test3') DEFAULT NULL, `col58` datetime DEFAULT NULL, `col59` mediumtext, `col60` varchar(232) DEFAULT NULL, `col61` decimal(10,0) DEFAULT NULL, `col62` year(4) DEFAULT NULL, `col63` smallint(6) DEFAULT NULL, `col64` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col65` blob, `col66` longblob, `col67` int(11) DEFAULT NULL, `col68` longtext, `col69` enum('test1','test2','test3') DEFAULT NULL, `col70` int(11) DEFAULT NULL, `col71` time DEFAULT NULL, `col72` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col73` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col74` varchar(170) DEFAULT NULL, `col75` set('test1','test2','test3') DEFAULT NULL, `col76` tinyblob, `col77` bigint(20) DEFAULT NULL, `col78` decimal(10,0) DEFAULT NULL, `col79` datetime DEFAULT NULL, `col80` year(4) DEFAULT NULL, `col81` decimal(10,0) DEFAULT NULL, `col82` longblob, `col83` text, `col84` char(83) DEFAULT NULL, `col85` decimal(10,0) DEFAULT NULL, `col86` float DEFAULT NULL, `col87` int(11) DEFAULT NULL, `col88` varchar(145) DEFAULT NULL, `col89` date DEFAULT NULL, `col90` decimal(10,0) DEFAULT NULL, `col91` decimal(10,0) DEFAULT NULL, `col92` mediumblob, `col93` time DEFAULT NULL, KEY `idx0` (`col69`,`col90`,`col8`), KEY `idx1` (`col60`), KEY `idx2` (`col60`,`col70`,`col74`), KEY `idx3` (`col22`,`col32`,`col72`,`col30`), KEY `idx4` (`col29`), KEY `idx5` (`col19`,`col45`(143)), KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)), KEY `idx7` (`col48`,`col61`), KEY `idx8` (`col93`), KEY `idx9` (`col31`), KEY `idx10` (`col30`,`col21`), KEY `idx11` (`col67`), KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)), KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)), KEY `idx14` (`col78`), KEY `idx15` (`col63`,`col67`,`col64`), KEY `idx16` (`col17`,`col86`), KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)), KEY `idx18` (`col62`), KEY `idx19` (`col31`,`col57`,`col56`,`col53`), KEY `idx20` (`col46`), KEY `idx21` (`col83`(54)), KEY `idx22` (`col51`,`col7`(120)), KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
insert ignore into `table0` set `col23` = 7887371.5084383683, `col24` = 4293854615.6906948000, `col25` = 'vitalist', `col26` = 'widespread', `col27` = '3570490', `col28` = 'habitual', `col30` = -5471, `col31` = 4286985783.6771750000, `col32` = 6354540.9826654866, `col33` = 'defoliation', `col34` = 'logarithms', `col35` = 'tegument\'s', `col36` = 'scouting\'s', `col37` = 'intermittency', `col38` = 'elongates', `col39` = 'prophecies', `col40` = '20560103035939', `col41` = 4292809130.0544143000, `col42` = 22057, `col43` = 'Hess\'s', `col44` = 'bandstand', `col45` = 'phenylketonuria', `col46` = 6338767.4018677324, `col47` = 5310247, `col48` = '12592418', `col49` = 'churchman\'s', `col50` = '32226125', `col51` = -58, `col52` = -6207968, `col53` = 1244839.3255104220, `col54` = 'robotized', `col55` = 'monotonous', `col56` = -26909, `col58` = '20720107023550', `col59` = 'suggestiveness\'s', `col60` = 'gemology', `col61` = 4287800670.2229986000, `col62` = '1944', `col63` = -16827, `col64` = '20700107212324', `col65` = 'Nicolais', `col66` = 'apteryx', `col67` = 6935317, `col68` = 'stroganoff', `col70` = 3316430, `col71` = '3277608', `col72` = '19300511045918', `col73` = '20421201003327', `col74` = 'attenuant', `col75` = '15173', `col76` = 'upstroke\'s', `col77` = 8118987, `col78` = 6791516.2735374002, `col79` = '20780701144624', `col80` = '2134', `col81` = 4290682351.3127537000, `col82` = 'unexplainably', `col83` = 'Storm', `col84` = 'Greyso\'s', `col85` = 4289119212.4306774000, `col86` = 7617575.8796655172, `col87` = -6325335, `col88` = 'fondue\'s', `col89` = '40608940', `col90` = 1659421.8093508712, `col91` = 8346904.6584368423, `col92` = 'reloads', `col93` = '5188366';
CHECK TABLE table0 EXTENDED;
INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.9055146948, `col21` = 4293243420.5621204000, `col22` = '20511211123705', `col23` = 4289899778.6573381000, `col24` = 4293449279.0540481000, `col25` = 'emphysemic', `col26` = 'dentally', `col27` = '2347406', `col28` = 'eruct', `col30` = 1222, `col31` = 4294372994.9941406000, `col32` = 4291385574.1173744000, `col33` = 'borrowing\'s', `col34` = 'septics', `col35` = 'ratter\'s', `col36` = 'Kaye', `col37` = 'Florentia', `col38` = 'allium', `col39` = 'barkeep', `col40` = '19510407003441', `col41` = 4293559200.4215522000, `col42` = 22482, `col43` = 'decussate', `col44` = 'Brom\'s', `col45` = 'violated', `col46` = 4925506.4635456400, `col47` = 930549, `col48` = '51296066', `col49` = 'voluminously', `col50` = '29306676', `col51` = -88, `col52` = -2153690, `col53` = 4290250202.1464887000, `col54` = 'expropriation', `col55` = 'Aberdeen\'s', `col56` = 20343, `col58` = '19640415171532', `col59` = 'extern', `col60` = 'Ubana', `col61` = 4290487961.8539081000, `col62` = '2147', `col63` = -24271, `col64` = '20750801194548', `col65` = 'Cunaxa\'s', `col66` = 'pasticcio', `col67` = 2795817, `col68` = 'Indore\'s', `col70` = 6864127, `col71` = '1817832', `col72` = '20540506114211', `col73` = '20040101012300', `col74` = 'rationalized', `col75` = '45522', `col76` = 'indene', `col77` = -6964559, `col78` = 4247535.5266884370, `col79` = '20720416124357', `col80` = '2143', `col81` = 4292060102.4466386000, `col82` = 'striving', `col83` = 'boneblack\'s', `col84` = 'redolent', `col85` = 6489697.9009369183, `col86` = 4287473465.9731131000, `col87` = 7726015, `col88` = 'perplexed', `col89` = '17153791', `col90` = 5478587.1108127078, `col91` = 4287091404.7004304000, `col92` = 'Boulez\'s', `col93` = '2931278';
CHECK TABLE table0 EXTENDED;
DROP TABLE table0;
SET GLOBAL innodb_file_per_table=DEFAULT;
SET GLOBAL innodb_file_format='Antelope';
SET GLOBAL innodb_file_format_check='Antelope';
#
# Make sure http://bugs.mysql.com/41904 remains fixed.
#
-- source include/not_embedded.inc
-- source include/have_innodb.inc
CREATE TABLE bug41904 (id INT PRIMARY KEY, uniquecol CHAR(15)) ENGINE=InnoDB;
INSERT INTO bug41904 VALUES (1,NULL), (2,NULL);
CREATE UNIQUE INDEX ui ON bug41904 (uniquecol);
DROP TABLE bug41904;
......@@ -6,16 +6,15 @@
--source include/have_innodb.inc
# This create table operation should fail.
--error ER_CANT_CREATE_TABLE
--error ER_WRONG_COLUMN_NAME
create table bug44369 (DB_ROW_ID int) engine=innodb;
show warnings;
# This create should fail as well
--error ER_CANT_CREATE_TABLE
--error ER_WRONG_COLUMN_NAME
create table bug44369 (db_row_id int) engine=innodb;
show warnings;
show errors;
--error ER_CANT_CREATE_TABLE
--error ER_WRONG_COLUMN_NAME
create table bug44369 (db_TRX_Id int) engine=innodb;
show errors;
show warnings;
#
# Bug #51920: InnoDB connections in lock wait ignore KILL until timeout
#
-- source include/not_embedded.inc
-- source include/have_innodb.inc
CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
INSERT INTO bug51920 VALUES (1);
BEGIN;
SELECT * FROM bug51920 FOR UPDATE;
connect (con1,localhost,root,,);
connection con1;
--send
UPDATE bug51920 SET i=2;
connection default;
let $wait_condition =
SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE INFO="UPDATE bug51920 SET i=2";
-- source include/wait_condition.inc
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE INFO="UPDATE bug51920 SET i=2"
INTO @thread_id;
KILL @thread_id;
let $wait_condition =
SELECT COUNT(*)=0 FROM information_schema.processlist WHERE ID=@thread_id;
-- source include/wait_condition.inc
#
# Bug#19723: kill of active connection yields different error code
# depending on platform.
#
connection con1;
-- error 1317, 2006, 2013
reap;
connection default;
DROP TABLE bug51920;
-- disconnect con1
--source include/have_innodb.inc
set session transaction isolation level read committed;
create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
(what, id)) engine=innodb;
insert into innodb_bug52663 values ('total', 0, 0);
begin;
connect (addconroot, localhost, root,,);
connection addconroot;
set session transaction isolation level read committed;
begin;
connection default;
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
select * from innodb_bug52663;
connection addconroot;
--error ER_LOCK_WAIT_TIMEOUT
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
select * from innodb_bug52663;
connection default;
commit;
connection addconroot;
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
commit;
select * from innodb_bug52663;
connection default;
select * from innodb_bug52663;
drop table innodb_bug52663;
--binlog_cache_size=32768 --innodb_lock_wait_timeout=1
This diff is collapsed.
drop table if exists t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (null);
INSERT INTO t1 VALUES (null);
ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
SELECT * FROM t1;
d1
1
2
SELECT * FROM t1;
d1
1
2
INSERT INTO t1 VALUES(null);
ALTER TABLE t1 AUTO_INCREMENT = 3;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`d1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`d1`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
d1
1
2
3
4
DROP TABLE t1;
This diff is collapsed.
set global innodb_table_locks=1;
select @@innodb_table_locks;
@@innodb_table_locks
1
drop table if exists t1;
set @@innodb_table_locks=1;
create table t1 (id integer, x integer) engine=INNODB;
insert into t1 values(0, 0);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
id x
0 0
set autocommit=0;
lock table t1 write;
update t1 set x=1 where id = 0;
select * from t1;
id x
0 1
commit;
update t1 set x=2 where id = 0;
commit;
unlock tables;
select * from t1;
id x
0 2
commit;
drop table t1;
set @@innodb_table_locks=0;
create table t1 (id integer primary key, x integer) engine=INNODB;
insert into t1 values(0, 0),(1,1),(2,2);
commit;
SELECT * from t1 where id = 0 FOR UPDATE;
id x
0 0
set autocommit=0;
set @@innodb_table_locks=0;
lock table t1 write;
update t1 set x=10 where id = 2;
SELECT * from t1 where id = 2;
id x
2 2
UPDATE t1 set x=3 where id = 2;
commit;
SELECT * from t1;
id x
0 0
1 1
2 3
commit;
unlock tables;
commit;
select * from t1;
id x
0 0
1 1
2 10
drop table t1;
drop table if exists t1;
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb;
select * from t1;
c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","11");
ERROR HY000: DELAYED option not supported for table 't1'
select * from t1;
c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","12");
ERROR HY000: DELAYED option not supported for table 't1'
select * from t1;
c1 c2 stamp
drop table t1;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment