auto-merge mysql-5.1->mysql-5.1-security

This commit is contained in:
Georgi Kodinov 2011-10-12 14:34:44 +03:00
commit 494b581f14
166 changed files with 2622 additions and 1006 deletions

View File

@ -4290,7 +4290,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
{
char init_command[100];
sprintf(init_command,
"SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=%lu,SQL_MAX_JOIN_SIZE=%lu",
"SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=%lu,MAX_JOIN_SIZE=%lu",
select_limit,max_join_size);
mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command);
}

View File

@ -451,6 +451,7 @@ TYPELIB command_typelib= {array_elements(command_names),"",
command_names, 0};
DYNAMIC_STRING ds_res;
struct st_command *curr_command= 0;
char builtin_echo[FN_REFLEN];
@ -2212,9 +2213,16 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
do_eval(&ds_query, query, end, FALSE);
if (mysql_real_query(mysql, ds_query.str, ds_query.length))
die("Error running query '%s': %d %s", ds_query.str,
mysql_errno(mysql), mysql_error(mysql));
if (mysql_real_query(mysql, ds_query.str, ds_query.length))
{
handle_error (curr_command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), &ds_res);
/* If error was acceptable, return empty string */
dynstr_free(&ds_query);
eval_expr(var, "", 0);
DBUG_VOID_RETURN;
}
if (!(res= mysql_store_result(mysql)))
die("Query '%s' didn't return a result set", ds_query.str);
dynstr_free(&ds_query);
@ -2315,8 +2323,15 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
/* Run the query */
if (mysql_real_query(mysql, ds_query.str, ds_query.length))
die("Error running query '%s': %d %s", ds_query.str,
mysql_errno(mysql), mysql_error(mysql));
{
handle_error (curr_command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), &ds_res);
/* If error was acceptable, return empty string */
dynstr_free(&ds_query);
eval_expr(var, "", 0);
DBUG_VOID_RETURN;
}
if (!(res= mysql_store_result(mysql)))
die("Query '%s' didn't return a result set", ds_query.str);
@ -8147,6 +8162,8 @@ int main(int argc, char **argv)
{
command->last_argument= command->first_argument;
processed = 1;
/* Need to remember this for handle_error() */
curr_command= command;
switch (command->type) {
case Q_CONNECT:
do_connect(command);

View File

@ -2711,7 +2711,7 @@ then
MAN_DROP="$MAN_DROP embedded"
grep -v 'embedded' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
fi
if test X"$with_plugin_innobase" != Xyes
if test X"$with_plugin_innobase" != Xyes -a X"$with_plugin_innodb_plugin" != Xyes
then
MAN_DROP="$MAN_DROP innodb"
grep -v 'inno' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
@ -2790,7 +2790,7 @@ then
fi
# "innochecksum" is not in the "innobase/" subdirectory, but should be switched
AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes])
AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes -o X"$with_plugin_innodb_plugin" = Xyes ])
# IMPORTANT - do not modify LIBS past this line - this hack is the only way
# I know to add the static NSS magic if we have static NSS libraries with

View File

@ -25,12 +25,7 @@
Published with a permission.
*/
/* needed to have access to 64 bit file functions */
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _XOPEN_SOURCE 500 /* needed to include getopt.h on some platforms. */
#include <my_global.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@ -53,7 +48,6 @@
/* another argument to specify page ranges... seek to right spot and go from there */
typedef unsigned long int ulint;
typedef unsigned char uchar;
/* innodb function in name; modified slightly to not have the ASM version (lots of #ifs that didn't apply) */
ulint mach_read_from_4(uchar *b)

View File

@ -21,6 +21,15 @@ typedef enum
decimal_round_mode;
typedef int32 decimal_digit_t;
/**
intg is the number of *decimal* digits (NOT number of decimal_digit_t's !)
before the point
frac is the number of decimal digits after the point
len is the length of buf (length of allocated space) in decimal_digit_t's,
not in bytes
sign false means positive, true means negative
buf is an array of decimal_digit_t's
*/
typedef struct st_decimal_t {
int intg, frac, len;
my_bool sign;

View File

@ -50,6 +50,7 @@ typedef struct st_heapinfo /* Struct from heap_info */
uint reclength; /* Length of one record */
int errkey;
ulonglong auto_increment;
time_t create_time;
} HEAPINFO;
@ -146,6 +147,7 @@ typedef struct st_heap_share
uint open_count;
uchar *del_link; /* Link to next block with del. rec */
char * name; /* Name of "memory-file" */
time_t create_time;
#ifdef THREAD
THR_LOCK lock;
pthread_mutex_t intern_lock; /* Locking for use with _locking */

View File

@ -0,0 +1,5 @@
if (`select plugin_library IS NULL from information_schema.plugins where plugin_name LIKE '%federated%'`)
{
--skip federated plugin not available
}

View File

@ -27,7 +27,8 @@ BEGIN
-- Dump all global variables except those
-- that are supposed to change
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE variable_name != 'timestamp' ORDER BY VARIABLE_NAME;
WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_check')
ORDER BY VARIABLE_NAME;
-- Dump all databases, there should be none
-- except those that was created during bootstrap
@ -72,3 +73,13 @@ BEGIN
mysql.user;
END||
--
-- Procedure used by test case used to force all
-- servers to restart after testcase and thus skipping
-- check test case after test
--
CREATE DEFINER=root@localhost PROCEDURE force_restart()
BEGIN
SELECT 1 INTO OUTFILE 'force_restart';
END||

View File

@ -222,8 +222,11 @@ sub collect_test_cases ($$$) {
sub split_testname {
my ($test_name)= @_;
# Get rid of directory part and split name on .'s
my @parts= split(/\./, basename($test_name));
# If .test file name is used, get rid of directory part
$test_name= basename($test_name) if $test_name =~ /\.test$/;
# Now split name on .'s
my @parts= split(/\./, $test_name);
if (@parts == 1){
# Only testname given, ex: alias
@ -317,10 +320,30 @@ sub collect_one_suite($)
my %disabled;
if ( open(DISABLED, "$testdir/disabled.def" ) )
{
# $^O on Windows considered not generic enough
my $plat= (IS_WINDOWS) ? 'windows' : $^O;
while ( <DISABLED> )
{
chomp;
if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
#diasble the test case if platform matches
if ( /\@/ )
{
if ( /\@$plat/ )
{
/^\s*(\S+)\s*\@$plat.*:\s*(.*?)\s*$/ ;
$disabled{$1}= $2;
}
elsif ( /\@!(\S*)/ )
{
if ( $1 ne $plat)
{
/^\s*(\S+)\s*\@!.*:\s*(.*?)\s*$/ ;
$disabled{$1}= $2;
}
}
}
elsif ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
{
$disabled{$1}= $2;
}

View File

@ -1979,6 +1979,24 @@ sub environment_setup {
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename;
}
# --------------------------------------------------------------------------
# Add the path where mysqld will find ha_federated.so
# --------------------------------------------------------------------------
my $fedplug_filename;
if (IS_WINDOWS) {
$fedplug_filename = "ha_federated.dll";
} else {
$fedplug_filename = "ha_federated.so";
}
my $lib_fed_plugin=
mtr_file_exists(vs_config_dirs('storage/federated',$fedplug_filename),
"$basedir/storage/federated/.libs/".$fedplug_filename,
"$basedir/lib/mysql/plugin/".$fedplug_filename);
$ENV{'FEDERATED_PLUGIN'}= $fedplug_filename;
$ENV{'FEDERATED_PLUGIN_DIR'}=
($lib_fed_plugin ? dirname($lib_fed_plugin) : "");
# ----------------------------------------------------
# Add the path where mysqld will find mypluglib.so
# ----------------------------------------------------
@ -2112,6 +2130,12 @@ sub environment_setup {
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= mysql_fix_arguments();
$ENV{'EXE_MYSQL'}= $exe_mysql;
my $exe_mysqld= find_mysqld($basedir);
$ENV{'MYSQLD'}= $exe_mysqld;
my $extra_opts= join (" ", @opt_extra_mysqld_opt);
$ENV{'MYSQLD_CMD'}= "$exe_mysqld --defaults-group-suffix=.1 ".
"--defaults-file=$path_config_file $extra_opts";
# ----------------------------------------------------
# bug25714 executable may _not_ exist in
# some versions, test using it should be skipped
@ -3831,6 +3855,11 @@ sub extract_server_log ($$) {
else
{
push(@lines, $line);
if (scalar(@lines) > 1000000) {
$Ferr = undef;
mtr_warning("Too much log from test, bailing out from extracting");
return ();
}
}
}
else

View File

@ -83,5 +83,18 @@ a a b filler
SET SESSION debug = DEFAULT;
DROP TABLE t1, t2;
#
# Bug#11747970 34660: CRASH WHEN FEDERATED TABLE LOSES CONNECTION DURING INSERT ... SELECT
#
CREATE TABLE t1(f1 INT, KEY(f1));
CREATE TABLE t2(f1 INT);
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
SET SESSION debug='d,bug11747970_simulate_error';
INSERT IGNORE INTO t2 SELECT f1 FROM t1 a WHERE NOT EXISTS (SELECT 1 FROM t2 b WHERE a.f1 = b.f1);
Warnings:
Error 1105 Unknown error
SET SESSION debug = DEFAULT;
DROP TABLE t1,t2;
#
# End of 5.1 tests
#

View File

@ -1891,4 +1891,36 @@ a AVG(t1.b) t11c t12c
1 4.0000 6 6
2 2.0000 7 7
DROP TABLE t1;
#
# Bug#11765254 (58200): Assertion failed: param.sort_length when grouping
# by functions
#
SET SQL_BIG_TABLES=1;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (0),(0);
SELECT 1 FROM t1 GROUP BY IF(`a`,'','');
1
1
SELECT 1 FROM t1 GROUP BY TRIM(LEADING RAND() FROM '');
1
1
SELECT 1 FROM t1 GROUP BY SUBSTRING('',SLEEP(0),'');
1
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: ''
SELECT 1 FROM t1 GROUP BY SUBSTRING(SYSDATE() FROM 'K' FOR 'jxW<');
1
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'K'
Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
Warning 1292 Truncated incorrect INTEGER value: 'K'
Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
Warning 1292 Truncated incorrect INTEGER value: 'K'
Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
DROP TABLE t1;
SET SQL_BIG_TABLES=0;
# End of 5.1 tests

View File

@ -715,8 +715,8 @@ create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
show table status like 't_';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
drop table t1, t2;
CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;

View File

@ -2341,4 +2341,33 @@ REPAIR TABLE m1;
Table Op Msg_type Msg_text
test.m1 repair note The storage engine for the table doesn't support repair
DROP TABLE m1, t1;
#
# BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD
# CRASHES SERVER
#
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
CREATE TABLE t3(a INT, b INT);
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
# Test reopen merge parent failure
LOCK TABLES m1 READ;
# Remove 'm1' table using file operations.
FLUSH TABLES;
ERROR 42S02: Table 'test.m1' doesn't exist
UNLOCK TABLES;
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
# Test reopen merge child failure
LOCK TABLES m1 READ;
# Remove 't1' table using file operations.
FLUSH TABLES;
ERROR 42S02: Table 'test.t1' doesn't exist
UNLOCK TABLES;
CREATE TABLE t1(a INT);
# Test reattach merge failure
LOCK TABLES m1 READ;
# Replace 't1' with 't3' table using file operations.
FLUSH TABLES;
ERROR HY000: Can't reopen table: 'm1'
UNLOCK TABLES;
DROP TABLE t1, t2, t3, m1;
End of 5.1 tests

View File

@ -87,3 +87,35 @@ COUNT(*)
128
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
#
# BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
#
CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
INSERT INTO t1 VALUES('aaaa'),('bbbb'),('cccc');
FLUSH TABLE t1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa' IN BOOLEAN MODE);
a
aaaa
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa');
a
aaaa
DROP TABLE t1;
# Test table with key_reflength > rec_reflength
CREATE TABLE t1(a CHAR(30), FULLTEXT(a));
# Populating a table, so it's index file exceeds 65K
# Populating a table, so index file has second level fulltext tree
FLUSH TABLE t1;
# Compressing table
# Fixing index (repair by sort)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
FLUSH TABLE t1;
# Fixing index (repair with keycache)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;

View File

@ -135,6 +135,10 @@ select 1146 as "after_!errno_masked_error" ;
after_!errno_masked_error
1146
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1000...
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 'garbage' at line 1
is empty
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 'nonsense' at line 1
is empty
garbage ;
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 'garbage' at line 1
select 1064 as "after_--enable_abort_on_error" ;
@ -143,6 +147,9 @@ after_--enable_abort_on_error
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1064...
is empty
is empty
"Yes it's empty"
hello
hello
;;;;;;;;
@ -315,7 +322,7 @@ insert into t1 values ('$dollar');
$dollar
`select 42`
drop table t1;
mysqltest: At line 1: Error running query 'failing query': 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 'failing query' at line 1
mysqltest: At line 1: query 'let $var2= `failing query`' failed: 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 'failing query' at line 1
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
@ -813,7 +820,7 @@ mysqltest: At line 1: Could not find column 'column_not_exists' in the result of
mysqltest: At line 1: Query 'SET @A = 1' didn't return a result set
mysqltest: At line 1: Could not find column '1 AS B' in the result of 'SELECT 1 AS A'
value= No such row
mysqltest: At line 1: Error running query 'SHOW COLNS FROM t1': 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 'COLNS FROM t1' at line 1
mysqltest: At line 1: query 'let $value= query_get_value(SHOW COLNS FROM t1, Field, 1)' failed: 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 'COLNS FROM t1' at line 1
Field Type Null Key Default Extra
a int(11) YES -><- NULL

View File

@ -25,7 +25,6 @@ call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB
#
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
#
SET @old_innodb_file_format_check = @@global.innodb_file_format_check;
SET @old_innodb_file_format = @@global.innodb_file_format;
SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
@ -93,7 +92,6 @@ DROP TABLE t1;
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_format = @old_innodb_file_format;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
SET @@global.innodb_file_format_check = @old_innodb_file_format_check;
SET NAMES utf8;
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
ENGINE=InnoDB

View File

@ -30,7 +30,7 @@ ERROR HY000: You are using safe update mode and you tried to update a table with
delete from t1 where a+0=1;
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
update t1 set b="a" limit 1;
update t1 set b="a" where b="b" limit 2;
delete from t1 where b="test" limit 1;
@ -42,7 +42,7 @@ SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS;
2 0
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
SELECT * from t1 order by a;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
SET SQL_BIG_SELECTS=1;
SELECT * from t1 order by a;
a b
@ -52,7 +52,7 @@ a b
5 a
SET MAX_JOIN_SIZE=2;
SELECT * from t1;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
SET MAX_JOIN_SIZE=DEFAULT;
SELECT * from t1;
a b
@ -82,12 +82,12 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
set local max_join_size=8;
select * from (select * from t1) x;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
set local max_join_size=1;
select * from (select a.a as aa, b.a as ba from t1 a, t1 b) x;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
set local max_join_size=1;
select * from (select 1 union select 2 union select 3) x;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
drop table t1;
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;

View File

@ -458,57 +458,57 @@ insert into t2 values (1),(2);
insert into t3 values (1,1),(2,2);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t1 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
insert into t1 values (3),(4);
insert into t2 values (3),(4);
insert into t3 values (3,3),(4,4);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t1 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t1 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
delete from t1 where a=3;
delete from t2 where b=3;
delete from t3 where a=3;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
t1 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
truncate table t1;
truncate table t2;
truncate table t3;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t1 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t1 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
delete from t1 where a=5;
delete from t2 where b=5;
delete from t3 where a=5;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
t1 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
t2 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
t3 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
drop table t1, t2, t3;
create database mysqltest;
show create database mysqltest;
@ -659,7 +659,7 @@ DROP TABLE t1;
flush tables;
SHOW TABLE STATUS like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
t1 NULL NULL NULL NULL # # # # NULL NULL # NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
Warnings:
Warning 1033 Incorrect information in file: './test/t1.frm'
show create table t1;

View File

@ -556,3 +556,49 @@ f1 bug13575(f1)
3 ccc
drop function bug13575|
drop table t3|
SELECT @@GLOBAL.storage_engine INTO @old_engine|
SET @@GLOBAL.storage_engine=InnoDB|
SET @@SESSION.storage_engine=InnoDB|
SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
Variable_name Value
storage_engine InnoDB
SHOW SESSION VARIABLES LIKE 'storage_engine'|
Variable_name Value
storage_engine InnoDB
CREATE PROCEDURE bug11758414()
BEGIN
SET @@GLOBAL.storage_engine="MyISAM";
SET @@SESSION.storage_engine="MyISAM";
# show defaults at execution time / that setting them worked
SHOW GLOBAL VARIABLES LIKE 'storage_engine';
SHOW SESSION VARIABLES LIKE 'storage_engine';
CREATE TABLE t1 (id int);
CREATE TABLE t2 (id int) ENGINE=InnoDB;
# show we're heeding the default (at run-time, not parse-time!)
SHOW CREATE TABLE t1;
# show that we didn't break explicit override with ENGINE=...
SHOW CREATE TABLE t2;
END;
|
CALL bug11758414|
Variable_name Value
storage_engine MyISAM
Variable_name Value
storage_engine MyISAM
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
Variable_name Value
storage_engine MyISAM
SHOW SESSION VARIABLES LIKE 'storage_engine'|
Variable_name Value
storage_engine MyISAM
DROP PROCEDURE bug11758414|
DROP TABLE t1, t2|
SET @@GLOBAL.storage_engine=@old_engine|

View File

@ -1927,3 +1927,14 @@ f1
0.000000000000000000000000
DROP TABLE IF EXISTS t1;
End of 5.1 tests
#
# BUG#12911710 - VALGRIND FAILURE IN
# ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
#
CREATE TABLE t1(d1 DECIMAL(60,0) NOT NULL,
d2 DECIMAL(60,0) NOT NULL);
INSERT INTO t1 (d1, d2) VALUES(0.0, 0.0);
SELECT d1 * d2 FROM t1;
d1 * d2
0
DROP TABLE t1;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1,t2,t3;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
@ -89,3 +90,4 @@ c1
2007-02-16 12:10:34
2007-02-17 13:10:34
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NULL, c3 DATE NULL, PRIMARY KEY(c1), UNIQUE(c2));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'4 04:01:01'),NOW());
@ -128,3 +129,4 @@ c1 c2 c3
2003 2001 2000
2004 2000 2000
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
@ -82,3 +83,4 @@ c1
2000
2011
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
@ -87,3 +88,4 @@ c1
1999
2000
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
@ -87,3 +88,4 @@ c1
1999
2000
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL UNIQUE);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
@ -82,3 +83,4 @@ c1
2000
2011
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL UNIQUE);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
@ -87,3 +88,4 @@ c1
1999
2000
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL UNIQUE);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
@ -81,3 +82,4 @@ c1
1999
2000
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NOT NULL, c3 DATE NOT NULL, PRIMARY KEY(c1,c2,c3));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -144,3 +145,4 @@ c1 c2 c3
2011 2011 2000
2011 2011 2011
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NOT NULL, c3 DATE NOT NULL, PRIMARY KEY(c1,c2,c3));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -147,3 +148,4 @@ c1 c2 c3
1999 2000 1999
2000 1999 1999
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NOT NULL, c3 DATE NOT NULL, PRIMARY KEY(c1,c2,c3));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -147,3 +148,4 @@ c1 c2 c3
1999 2000 1999
2000 1999 1999
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL, c2 DATE NULL, c3 DATE NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -144,3 +145,4 @@ c1 c2 c3
2011 2011 2000
2011 2011 2011
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL, c2 DATE NULL, c3 DATE NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -147,3 +148,4 @@ c1 c2 c3
1999 2000 1999
2000 1999 1999
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL, c2 DATE NULL, c3 DATE NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -139,3 +140,4 @@ c1 c2 c3
1999 2000 1999
2000 1999 1999
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NOT NULL, c3 DATE NOT NULL, PRIMARY KEY(c1,c2,c3));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -144,3 +145,4 @@ c1 c2 c3
2011 2011 2000
2011 2011 2011
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,4 +1,5 @@
DROP TABLE IF EXISTS t1,t2,t3;
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
@ -104,3 +105,4 @@ c1
2007-02-13 09:09:33
2007-02-14 10:10:34
DROP TABLE t1;
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1) VALUES(NOW());
@ -45,4 +47,5 @@ SELECT * FROM t1 ORDER BY c1;
DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01');
SELECT * FROM t1 ORDER BY c1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NULL, c3 DATE NULL, PRIMARY KEY(c1), UNIQUE(c2));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'4 04:01:01'),NOW());
@ -70,4 +72,6 @@ INSERT INTO t1 (c1,c2,c3) VALUES(2000,2000,2000) ON DUPLICATE KEY UPDATE c3=2011
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1) VALUES(NOW());
@ -61,4 +63,5 @@ INSERT INTO t1 (c1) VALUES(1999) ON DUPLICATE KEY UPDATE c1=2011;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1) VALUES(NOW());
@ -61,4 +63,5 @@ INSERT INTO t1 (c1) VALUES(2000);
INSERT INTO t1 (c1) VALUES(1999);
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1) VALUES(NOW());
@ -61,4 +63,6 @@ INSERT INTO t1 (c1) VALUES(2000);
INSERT INTO t1 (c1) VALUES(1999);
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL UNIQUE);
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1) VALUES(NOW());
@ -61,4 +63,5 @@ INSERT INTO t1 (c1) VALUES(1999) ON DUPLICATE KEY UPDATE c1=2011;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL UNIQUE);
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1) VALUES(NOW());
@ -61,4 +63,5 @@ INSERT INTO t1 (c1) VALUES(2000);
INSERT INTO t1 (c1) VALUES(1999);
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL UNIQUE);
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1) VALUES(NOW());
@ -53,4 +55,5 @@ INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
SELECT * FROM t1;
DROP TABLE t1;
#restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NOT NULL, c3 DATE NOT NULL, PRIMARY KEY(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -85,4 +87,6 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000) ON DUPLICATE KEY UPDATE c1=2011
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NOT NULL, c3 DATE NOT NULL, PRIMARY KEY(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -93,4 +95,5 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NOT NULL, c3 DATE NOT NULL, PRIMARY KEY(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -93,4 +95,5 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL, c2 DATE NULL, c3 DATE NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -85,4 +87,5 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000) ON DUPLICATE KEY UPDATE c1=2011
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL, c2 DATE NULL, c3 DATE NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -93,4 +95,5 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NULL, c2 DATE NULL, c3 DATE NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -85,4 +87,6 @@ INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NOT NULL, c3 DATE NOT NULL, PRIMARY KEY(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
@ -93,4 +95,6 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000) ON DUPLICATE KEY UPDATE c1=2011
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -1,6 +1,8 @@
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3;
--enable_warnings
# Set Correct timezone to match result
SET TIME_ZONE="+03:00";
CREATE TABLE t1(c1 DATE NOT NULL);
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1) VALUES(NOW());
@ -53,4 +55,5 @@ UPDATE t1 SET c1 = NOW() WHERE c1 >= ADDTIME(NOW(),'2 02:01:01');
--sorted_result
SELECT * FROM t1 ORDER BY c1;
DROP TABLE t1;
# Restore timezone to default
SET TIME_ZONE= @@global.time_zone;

View File

@ -0,0 +1,2 @@
--plugin_dir=$FEDERATED_PLUGIN_DIR
--loose-federated=ON

View File

@ -0,0 +1,19 @@
CREATE TABLE t2(a int);
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
Warnings:
Warning 1286 Unknown table engine 'FEDERATED'
Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN federated SONAME 'FEDERATED_PLUGIN';
INSTALL PLUGIN FEDERATED SONAME 'FEDERATED_PLUGIN';
ERROR HY000: Function 'FEDERATED' already exists
UNINSTALL PLUGIN federated;
INSTALL PLUGIN federated SONAME 'FEDERATED_PLUGIN';
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
UNINSTALL PLUGIN federated;
UNINSTALL PLUGIN federated;
ERROR 42000: PLUGIN federated does not exist
DROP TABLE t2;

View File

@ -0,0 +1,37 @@
--source include/have_federated_plugin.inc
# Uninstall will not uninstall if ps has been used
--disable_ps_protocol
connect (master,localhost,root,,test,$MASTER_MYPORT,);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,);
connection master;
CREATE TABLE t2(a int);
connection slave;
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
eval INSTALL PLUGIN federated SONAME '$FEDERATED_PLUGIN';
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
--error ER_UDF_EXISTS
eval INSTALL PLUGIN FEDERATED SONAME '$FEDERATED_PLUGIN';
UNINSTALL PLUGIN federated;
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
eval INSTALL PLUGIN federated SONAME '$FEDERATED_PLUGIN';
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
UNINSTALL PLUGIN federated;
--error ER_SP_DOES_NOT_EXIST
UNINSTALL PLUGIN federated;
connection master;
DROP TABLE t2;

View File

@ -39,6 +39,81 @@ DELETE FROM t1_purge;
DELETE FROM t2_purge;
DELETE FROM t3_purge;
DELETE FROM t4_purge;
SET @r=REPEAT('a',500);
CREATE TABLE t12637786(a INT,
v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t12637786(a,v1);
INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t12637786 SET a=1000;
DELETE FROM t12637786;
create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
engine=innodb row_format=dynamic;
SET @r = repeat('a', 767);
insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
create index ndx_a on t12963823 (a(500));
create index ndx_b on t12963823 (b(500));
create index ndx_c on t12963823 (c(500));
create index ndx_d on t12963823 (d(500));
create index ndx_e on t12963823 (e(500));
create index ndx_f on t12963823 (f(500));
create index ndx_k on t12963823 (k(500));
create index ndx_l on t12963823 (l(500));
SET @r = repeat('b', 500);
update t12963823 set a=@r,b=@r,c=@r,d=@r;
update t12963823 set e=@r,f=@r,g=@r,h=@r;
update t12963823 set i=@r,j=@r,k=@r,l=@r;
update t12963823 set m=@r,n=@r,o=@r,p=@r;
alter table t12963823 drop index ndx_a;
alter table t12963823 drop index ndx_b;
create index ndx_g on t12963823 (g(500));
create index ndx_h on t12963823 (h(500));
create index ndx_i on t12963823 (i(500));
create index ndx_j on t12963823 (j(500));
create index ndx_m on t12963823 (m(500));
create index ndx_n on t12963823 (n(500));
create index ndx_o on t12963823 (o(500));
create index ndx_p on t12963823 (p(500));
show create table t12963823;
Table Create Table
t12963823 CREATE TABLE `t12963823` (
`a` blob,
`b` blob,
`c` blob,
`d` blob,
`e` blob,
`f` blob,
`g` blob,
`h` blob,
`i` blob,
`j` blob,
`k` blob,
`l` blob,
`m` blob,
`n` blob,
`o` blob,
`p` blob,
KEY `ndx_c` (`c`(500)),
KEY `ndx_d` (`d`(500)),
KEY `ndx_e` (`e`(500)),
KEY `ndx_f` (`f`(500)),
KEY `ndx_k` (`k`(500)),
KEY `ndx_l` (`l`(500)),
KEY `ndx_g` (`g`(500)),
KEY `ndx_h` (`h`(500)),
KEY `ndx_i` (`i`(500)),
KEY `ndx_j` (`j`(500)),
KEY `ndx_m` (`m`(500)),
KEY `ndx_n` (`n`(500)),
KEY `ndx_o` (`o`(500)),
KEY `ndx_p` (`p`(500))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
@ -1010,20 +1085,15 @@ ERROR HY000: Too big row
alter table t1 row_format=compact;
create index t1u on t1 (u(1));
drop table t1;
SET @r=REPEAT('a',500);
CREATE TABLE t1(a INT,
v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
CREATE TABLE bug12547647(
a INT NOT NULL, b BLOB NOT NULL, c TEXT,
PRIMARY KEY (b(10), a), INDEX (c(10))
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t1(a,v1);
INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t1 SET a=1000;
DELETE FROM t1;
DROP TABLE t1;
INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7731));
COMMIT;
UPDATE bug12547647 SET c = REPEAT('b',16928);
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
DROP TABLE bug12547647;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
set global innodb_file_format_check=Antelope;
@ -1228,3 +1298,5 @@ a b
3 b
DROP TABLE t1;
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
DROP TABLE t12637786;
DROP TABLE t12963823;

View File

@ -126,5 +126,4 @@ Warning 1265 Data truncated for column 'col79' at row 1
Warning 1264 Out of range value for column 'col84' at row 1
DROP TABLE bug52745;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_format_check=Antelope;
SET GLOBAL innodb_file_per_table=0;

View File

@ -12,5 +12,4 @@ Error 1118 Row size too large. The maximum row size for the used table type, not
Error 1030 Got error 139 from storage engine
DROP TABLE bug53591;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_format_check=Antelope;
SET GLOBAL innodb_file_per_table=0;

View File

@ -2,8 +2,6 @@
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
--disable_warnings
drop table if exists t1;
--enable_warnings
@ -20,10 +18,3 @@ SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
DROP TABLE t1;
#
# restore environment to the state it was before this test execution
#
-- disable_query_log
eval set global innodb_file_format_check=$innodb_file_format_check_orig;

View File

@ -2,8 +2,6 @@
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
--disable_warnings
drop table if exists t1;
--enable_warnings
@ -34,10 +32,3 @@ SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
DROP TABLE t1;
#
# restore environment to the state it was before this test execution
#
-- disable_query_log
eval set global innodb_file_format_check=$innodb_file_format_check_orig;

View File

@ -1,7 +1,5 @@
-- source include/have_innodb_plugin.inc
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
##
# Bug #56228: dropping tables from within an active statement crashes server
#
@ -33,10 +31,3 @@ SELECT bug56228();
DROP FUNCTION bug56228;
DROP TEMPORARY TABLE t2_56228;
DROP TEMPORARY TABLE IF EXISTS t1_56228;
#
# restore environment to the state it was before this test execution
#
-- disable_query_log
eval set global innodb_file_format_check=$innodb_file_format_check_orig;

View File

@ -2,8 +2,6 @@
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
--disable_warnings
drop table if exists t1;
--enable_warnings
@ -639,10 +637,3 @@ INSERT INTO t1 VALUES (18446744073709551615);
-- source include/restart_mysqld.inc
SHOW CREATE TABLE t1;
DROP TABLE t1;
#
# restore environment to the state it was before this test execution
#
-- disable_query_log
eval set global innodb_file_format_check=$innodb_file_format_check_orig;

View File

@ -61,7 +61,6 @@ SET storage_engine=InnoDB;
--disable_query_log
# These values can change during the test
LET $innodb_file_format_orig=`select @@innodb_file_format`;
LET $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
LET $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
--enable_query_log
@ -568,7 +567,6 @@ DROP TABLE IF EXISTS t1;
--disable_query_log
EVAL SET GLOBAL innodb_file_format=$innodb_file_format_orig;
EVAL SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig;
EVAL SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
EVAL SET SESSION innodb_strict_mode=$innodb_strict_mode_orig;
--enable_query_log

View File

@ -2,14 +2,12 @@
let $MYSQLD_DATADIR= `select @@datadir`;
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
set global innodb_file_per_table=on;
set global innodb_file_format='Barracuda';
# Test an assertion failure on purge.
# Bug #12429576 - Test an assertion failure on purge.
CREATE TABLE t1_purge (
A INT,
B BLOB, C BLOB, D BLOB, E BLOB,
@ -59,6 +57,68 @@ DELETE FROM t1_purge;
DELETE FROM t2_purge;
DELETE FROM t3_purge;
DELETE FROM t4_purge;
# Instead of doing a --sleep 10, wait until the rest of the tests in
# this file complete before dropping the tables. By then, the purge thread
# will have delt with the updates above.
# Bug#12637786 - Bad assert by purge thread for records with external data
# used in secondary indexes.
SET @r=REPEAT('a',500);
CREATE TABLE t12637786(a INT,
v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t12637786(a,v1);
INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t12637786 SET a=1000;
DELETE FROM t12637786;
# We need to activate the purge thread at this point to make sure it does not
# assert and is able to clean up the old versions of secondary index entries.
# But instead of doing a --sleep 10, wait until the rest of the tests in
# this file complete before dropping the table. By then, the purge thread
# will have delt with the updates above.
# Bug#12963823 - Test that the purge thread does not crash when
# the number of indexes has changed since the UNDO record was logged.
create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
engine=innodb row_format=dynamic;
SET @r = repeat('a', 767);
insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
create index ndx_a on t12963823 (a(500));
create index ndx_b on t12963823 (b(500));
create index ndx_c on t12963823 (c(500));
create index ndx_d on t12963823 (d(500));
create index ndx_e on t12963823 (e(500));
create index ndx_f on t12963823 (f(500));
create index ndx_k on t12963823 (k(500));
create index ndx_l on t12963823 (l(500));
SET @r = repeat('b', 500);
update t12963823 set a=@r,b=@r,c=@r,d=@r;
update t12963823 set e=@r,f=@r,g=@r,h=@r;
update t12963823 set i=@r,j=@r,k=@r,l=@r;
update t12963823 set m=@r,n=@r,o=@r,p=@r;
alter table t12963823 drop index ndx_a;
alter table t12963823 drop index ndx_b;
create index ndx_g on t12963823 (g(500));
create index ndx_h on t12963823 (h(500));
create index ndx_i on t12963823 (i(500));
create index ndx_j on t12963823 (j(500));
create index ndx_m on t12963823 (m(500));
create index ndx_n on t12963823 (n(500));
create index ndx_o on t12963823 (o(500));
create index ndx_p on t12963823 (p(500));
show create table t12963823;
# We need to activate the purge thread at this point to see if it crashes
# but instead of doing a --sleep 10, wait until the rest of the tests in
# this file complete before dropping the table. By then, the purge thread
# will have delt with the updates above.
eval set global innodb_file_per_table=$per_table;
eval set global innodb_file_format=$format;
@ -462,23 +522,18 @@ create index t1u on t1 (u(1));
drop table t1;
# Bug#12637786
SET @r=REPEAT('a',500);
CREATE TABLE t1(a INT,
v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
CREATE TABLE bug12547647(
a INT NOT NULL, b BLOB NOT NULL, c TEXT,
PRIMARY KEY (b(10), a), INDEX (c(10))
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t1(a,v1);
INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t1 SET a=1000;
DELETE FROM t1;
# Let the purge thread clean up this file.
-- sleep 10
DROP TABLE t1;
INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7731));
COMMIT;
# The following used to cause infinite undo log allocation.
--error ER_TOO_BIG_ROWSIZE
UPDATE bug12547647 SET c = REPEAT('b',16928);
DROP TABLE bug12547647;
eval set global innodb_file_per_table=$per_table;
eval set global innodb_file_format=$format;
@ -617,11 +672,9 @@ disconnect a;
disconnect b;
DROP TABLE t1;
# Drop these tables since the purge thread must have run by now
# and did not crash.
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
#
# restore environment to the state it was before this test execution
#
-- disable_query_log
eval SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig;
DROP TABLE t12637786;
DROP TABLE t12963823;

View File

@ -2,7 +2,6 @@
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
set global innodb_file_per_table=off;
set global innodb_file_format=`0`;
@ -337,4 +336,3 @@ drop table normal_table, zip_table;
-- disable_query_log
eval set global innodb_file_format=$format;
eval set global innodb_file_per_table=$per_table;
eval set global innodb_file_format_check=$innodb_file_format_check_orig;

View File

@ -15,7 +15,6 @@ SET storage_engine=InnoDB;
-- disable_result_log
let $file_format=`select @@innodb_file_format`;
let $file_format_check=`select @@innodb_file_format_check`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on;
@ -28,5 +27,4 @@ INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.90
CHECK TABLE table0 EXTENDED;
DROP TABLE table0;
EVAL SET GLOBAL innodb_file_format=$file_format;
EVAL SET GLOBAL innodb_file_format_check=$file_format_check;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;

View File

@ -0,0 +1 @@
--force-restart

View File

@ -1,7 +1,6 @@
-- source include/have_innodb_plugin.inc
let $file_format=`select @@innodb_file_format`;
let $file_format_check=`select @@innodb_file_format_check`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on;
@ -105,5 +104,4 @@ SHOW WARNINGS;
DROP TABLE bug52745;
EVAL SET GLOBAL innodb_file_format=$file_format;
EVAL SET GLOBAL innodb_file_format_check=$file_format_check;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;

View File

@ -1,7 +1,6 @@
-- source include/have_innodb_plugin.inc
let $file_format=`select @@innodb_file_format`;
let $file_format_check=`select @@innodb_file_format_check`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
@ -18,5 +17,4 @@ SHOW WARNINGS;
DROP TABLE bug53591;
EVAL SET GLOBAL innodb_file_format=$file_format;
EVAL SET GLOBAL innodb_file_format_check=$file_format_check;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;

View File

@ -7,7 +7,6 @@
SET @tx_isolation_orig = @@tx_isolation;
SET @innodb_file_per_table_orig = @@innodb_file_per_table;
SET @innodb_file_format_orig = @@innodb_file_format;
SET @innodb_file_format_check_orig = @@innodb_file_format_check;
# The flag innodb_change_buffering_debug is only available in debug builds.
# It instructs InnoDB to try to evict pages from the buffer pool when
# change buffering is possible, so that the change buffer will be used
@ -137,6 +136,5 @@ DROP TABLE bug56680;
SET GLOBAL tx_isolation = @tx_isolation_orig;
SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
SET GLOBAL innodb_file_format = @innodb_file_format_orig;
SET GLOBAL innodb_file_format_check = @innodb_file_format_check_orig;
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;

View File

@ -3,8 +3,6 @@
-- source include/not_embedded.inc
-- source include/have_innodb_plugin.inc
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
COMMIT;
@ -66,5 +64,3 @@ XA COMMIT '789';
SELECT * FROM t;
DROP TABLE t;
--disable_query_log
eval set global innodb_file_format_check=$innodb_file_format_check_orig;

View File

@ -0,0 +1 @@
--force-restart

View File

@ -1,3 +1,4 @@
-- source include/have_ndb.inc
disable_query_log;
--require r/true.require
select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';

View File

@ -41,7 +41,7 @@ id name id name
SET @@session.max_join_size=8;
## Since total joins are more than max_join_size value so error will occur ##
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
'#--------------------FN_DYNVARS_079_03-------------------------#'
## Setting global value of variable ##
SET @@global.max_join_size=8;
@ -52,7 +52,7 @@ SELECT @@global.max_join_size;
8
## Since total joins are more than max_join_size value so error will occur ##
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
## Dropping both the tables ##
Drop table t1, t2;
## Restoring values ##

View File

@ -19,7 +19,7 @@ INSERT INTO t2 VALUES('aa4','bb');
'#--------------------FN_DYNVARS_154_01-------------------------#'
Expected error "Too big select"
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
'#--------------------FN_DYNVARS_154_02-------------------------#'
SET SESSION SQL_BIG_SELECTS = 1;

View File

@ -17,7 +17,7 @@ INSERT INTO t2 VALUES('aa4','bb');
'#--------------------FN_DYNVARS_161_01-------------------------#'
SET SESSION sql_max_join_size=9;
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
'#--------------------FN_DYNVARS_161_02-------------------------#'
SET SESSION SQL_BIG_SELECTS = 1;

View File

@ -89,6 +89,20 @@ SET SESSION debug = DEFAULT;
DROP TABLE t1, t2;
--echo #
--echo # Bug#11747970 34660: CRASH WHEN FEDERATED TABLE LOSES CONNECTION DURING INSERT ... SELECT
--echo #
CREATE TABLE t1(f1 INT, KEY(f1));
CREATE TABLE t2(f1 INT);
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
SET SESSION debug='d,bug11747970_simulate_error';
INSERT IGNORE INTO t2 SELECT f1 FROM t1 a WHERE NOT EXISTS (SELECT 1 FROM t2 b WHERE a.f1 = b.f1);
SET SESSION debug = DEFAULT;
DROP TABLE t1,t2;
--echo #
--echo # End of 5.1 tests
--echo #

View File

@ -1283,5 +1283,19 @@ FROM t1 GROUP BY a;
DROP TABLE t1;
--echo #
--echo # Bug#11765254 (58200): Assertion failed: param.sort_length when grouping
--echo # by functions
--echo #
SET SQL_BIG_TABLES=1;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (0),(0);
SELECT 1 FROM t1 GROUP BY IF(`a`,'','');
SELECT 1 FROM t1 GROUP BY TRIM(LEADING RAND() FROM '');
SELECT 1 FROM t1 GROUP BY SUBSTRING('',SLEEP(0),'');
SELECT 1 FROM t1 GROUP BY SUBSTRING(SYSDATE() FROM 'K' FOR 'jxW<');
DROP TABLE t1;
SET SQL_BIG_TABLES=0;
--echo # End of 5.1 tests

View File

@ -454,7 +454,7 @@ drop table t1;
#
create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
--replace_column 8 #
--replace_column 8 # 12 #
show table status like 't_';
drop table t1, t2;

View File

@ -1783,4 +1783,49 @@ REPAIR TABLE m1;
#
DROP TABLE m1, t1;
--echo #
--echo # BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD
--echo # CRASHES SERVER
--echo #
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
CREATE TABLE t3(a INT, b INT);
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
--echo # Test reopen merge parent failure
LOCK TABLES m1 READ;
--echo # Remove 'm1' table using file operations.
remove_file $MYSQLD_DATADIR/test/m1.MRG;
remove_file $MYSQLD_DATADIR/test/m1.frm;
--error ER_NO_SUCH_TABLE
FLUSH TABLES;
UNLOCK TABLES;
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
--echo # Test reopen merge child failure
LOCK TABLES m1 READ;
--echo # Remove 't1' table using file operations.
remove_file $MYSQLD_DATADIR/test/t1.frm;
remove_file $MYSQLD_DATADIR/test/t1.MYI;
remove_file $MYSQLD_DATADIR/test/t1.MYD;
--error ER_NO_SUCH_TABLE
FLUSH TABLES;
UNLOCK TABLES;
CREATE TABLE t1(a INT);
--echo # Test reattach merge failure
LOCK TABLES m1 READ;
--echo # Replace 't1' with 't3' table using file operations.
remove_file $MYSQLD_DATADIR/test/t1.frm;
remove_file $MYSQLD_DATADIR/test/t1.MYI;
remove_file $MYSQLD_DATADIR/test/t1.MYD;
copy_file $MYSQLD_DATADIR/test/t3.frm $MYSQLD_DATADIR/test/t1.frm;
copy_file $MYSQLD_DATADIR/test/t3.MYI $MYSQLD_DATADIR/test/t1.MYI;
copy_file $MYSQLD_DATADIR/test/t3.MYD $MYSQLD_DATADIR/test/t1.MYD;
--error ER_CANT_REOPEN_TABLE
FLUSH TABLES;
UNLOCK TABLES;
DROP TABLE t1, t2, t3, m1;
--echo End of 5.1 tests

View File

@ -107,3 +107,48 @@ SELECT COUNT(*) FROM mysql_db1.t1 WHERE c2 < 5;
#
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
--echo #
--echo # BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
--echo #
CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
INSERT INTO t1 VALUES('aaaa'),('bbbb'),('cccc');
FLUSH TABLE t1;
--exec $MYISAMPACK -sf $MYSQLD_DATADIR/test/t1
--exec $MYISAMCHK -srq $MYSQLD_DATADIR/test/t1
CHECK TABLE t1;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa' IN BOOLEAN MODE);
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa');
DROP TABLE t1;
--echo # Test table with key_reflength > rec_reflength
CREATE TABLE t1(a CHAR(30), FULLTEXT(a));
--disable_query_log
--echo # Populating a table, so it's index file exceeds 65K
let $1=1700;
while ($1)
{
eval INSERT INTO t1 VALUES('$1aaaaaaaaaaaaaaaaaaaaaaaaaa');
dec $1;
}
--echo # Populating a table, so index file has second level fulltext tree
let $1=60;
while ($1)
{
eval INSERT INTO t1 VALUES('aaaa'),('aaaa'),('aaaa'),('aaaa'),('aaaa');
dec $1;
}
--enable_query_log
FLUSH TABLE t1;
--echo # Compressing table
--exec $MYISAMPACK -sf $MYSQLD_DATADIR/test/t1
--echo # Fixing index (repair by sort)
--exec $MYISAMCHK -srnq $MYSQLD_DATADIR/test/t1
CHECK TABLE t1;
FLUSH TABLE t1;
--echo # Fixing index (repair with keycache)
--exec $MYISAMCHK -soq $MYSQLD_DATADIR/test/t1
CHECK TABLE t1;
DROP TABLE t1;

View File

@ -334,6 +334,14 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
exit(2);
EOF
# ----------------------------------------------------------------------------
# Check backtick and query_get_value, result should be empty
# ----------------------------------------------------------------------------
let $empty= `garbage`;
echo $empty is empty;
let $empty= query_get_value(nonsense, blabla, 1);
echo $empty is empty;
# ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno
# ----------------------------------------------------------------------------
@ -364,6 +372,23 @@ select 3 from t1 ;
--exec echo "disable_abort_on_error; enable_abort_on_error; error 1064; select 3 from t1; select 3 from t1;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test --error with backtick operator or query_get_value
# ----------------------------------------------------------------------------
--error 0,ER_NO_SUCH_TABLE
let $empty= `SELECT foo from bar`;
echo $empty is empty;
--error 0,ER_BAD_FIELD_ERROR
let $empty= query_get_value(SELECT bar as foo, baz, 1);
echo $empty is empty;
--error 0,ER_NO_SUCH_TABLE
if (!`SELECT foo from bar`) {
echo "Yes it's empty";
}
# ----------------------------------------------------------------------------
# Test comments
# ----------------------------------------------------------------------------

View File

@ -33,7 +33,6 @@ call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB
--echo #
--echo # Bug#55091: Server crashes on ADD PARTITION after a failed attempt
--echo #
SET @old_innodb_file_format_check = @@global.innodb_file_format_check;
SET @old_innodb_file_format = @@global.innodb_file_format;
SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
@ -92,7 +91,6 @@ DROP TABLE t1;
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_format = @old_innodb_file_format;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
SET @@global.innodb_file_format_check = @old_innodb_file_format_check;
#
# Bug#32430 - show engine innodb status causes errors

View File

@ -230,7 +230,7 @@ DROP TABLE """a";
#set names latin1;
#create database `ä`;
#create table `ä`.`ä` (a int) engine=heap;
#--replace_column 7 # 8 # 9 #
#--replace_column 7 # 8 # 9 # 12 #
#show table status from `ä` LIKE 'ä';
#drop database `ä`;
@ -276,37 +276,37 @@ CREATE TABLE t3 (
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1,1),(2,2);
--replace_column 6 # 7 # 8 # 9 #
--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
insert into t1 values (3),(4);
insert into t2 values (3),(4);
insert into t3 values (3,3),(4,4);
--replace_column 6 # 7 # 8 # 9 #
--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
--replace_column 6 # 7 # 8 # 9 #
--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
delete from t1 where a=3;
delete from t2 where b=3;
delete from t3 where a=3;
--replace_column 6 # 7 # 8 # 9 # 10 #
--replace_column 6 # 7 # 8 # 9 # 10 # 12 #
show table status;
truncate table t1;
truncate table t2;
truncate table t3;
--replace_column 6 # 7 # 8 # 9 #
--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
--replace_column 6 # 7 # 8 # 9 #
--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
delete from t1 where a=5;
delete from t2 where b=5;
delete from t3 where a=5;
--replace_column 6 # 7 # 8 # 9 # 10 #
--replace_column 6 # 7 # 8 # 9 # 10 # 12 #
show table status;
drop table t1, t2, t3;
@ -367,7 +367,7 @@ flush privileges;
#set names latin1;
#create database `ä`;
#create table `ä`.`ä` (a int) engine=heap;
#--replace_column 7 # 8 # 9 #
#--replace_column 7 # 8 # 9 # 12 #
#show table status from `ä` LIKE 'ä';
#drop database `ä`;
@ -430,7 +430,7 @@ flush tables;
# Create a junk frm file on disk
let $MYSQLD_DATADIR= `select @@datadir`;
system echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ;
--replace_column 6 # 7 # 8 # 9 #
--replace_column 6 # 7 # 8 # 9 # 12 #
SHOW TABLE STATUS like 't1';
--error ER_NOT_FORM_FILE
show create table t1;

View File

@ -593,6 +593,39 @@ drop function bug13575|
drop table t3|
#
# BUG#11758414: Default storage_engine not honored when set
# from within a stored procedure
#
SELECT @@GLOBAL.storage_engine INTO @old_engine|
SET @@GLOBAL.storage_engine=InnoDB|
SET @@SESSION.storage_engine=InnoDB|
# show defaults at define-time
SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
SHOW SESSION VARIABLES LIKE 'storage_engine'|
CREATE PROCEDURE bug11758414()
BEGIN
SET @@GLOBAL.storage_engine="MyISAM";
SET @@SESSION.storage_engine="MyISAM";
# show defaults at execution time / that setting them worked
SHOW GLOBAL VARIABLES LIKE 'storage_engine';
SHOW SESSION VARIABLES LIKE 'storage_engine';
CREATE TABLE t1 (id int);
CREATE TABLE t2 (id int) ENGINE=InnoDB;
# show we're heeding the default (at run-time, not parse-time!)
SHOW CREATE TABLE t1;
# show that we didn't break explicit override with ENGINE=...
SHOW CREATE TABLE t2;
END;
|
CALL bug11758414|
# show that changing defaults within SP stuck
SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
SHOW SESSION VARIABLES LIKE 'storage_engine'|
DROP PROCEDURE bug11758414|
DROP TABLE t1, t2|
SET @@GLOBAL.storage_engine=@old_engine|
#
# BUG#NNNN: New bug synopsis
#

View File

@ -1526,3 +1526,17 @@ DROP TABLE IF EXISTS t1;
--echo End of 5.1 tests
--echo #
--echo # BUG#12911710 - VALGRIND FAILURE IN
--echo # ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
--echo #
CREATE TABLE t1(d1 DECIMAL(60,0) NOT NULL,
d2 DECIMAL(60,0) NOT NULL);
INSERT INTO t1 (d1, d2) VALUES(0.0, 0.0);
SELECT d1 * d2 FROM t1;
DROP TABLE t1;

View File

@ -791,3 +791,40 @@
fun:fil_delete_tablespace
fun:row_drop_table_for_mysql
}
# Note the wildcard in the (mangled) function signatures of
# write_keys() and find_all_keys().
# They both return ha_rows, which is platform dependent.
{
Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / one
Memcheck:Param
write(buf)
obj:*/libpthread*.so
fun:my_write
fun:my_b_flush_io_cache
fun:_my_b_write
fun:_Z*10write_keysP13st_sort_paramPPhjP11st_io_cacheS4_
fun:_Z*13find_all_keysP13st_sort_paramP10SQL_SELECTPPhP11st_io_cacheS6_S6_
fun:_Z8filesortP3THDP8st_tableP13st_sort_fieldjP10SQL_SELECTybPy
}
{
Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / two
Memcheck:Param
write(buf)
obj:*/libpthread*.so
fun:my_write
fun:my_b_flush_io_cache
fun:_Z15merge_many_buffP13st_sort_paramPhP10st_buffpekPjP11st_io_cache
fun:_Z8filesortP3THDP8st_tableP13st_sort_fieldjP10SQL_SELECTybPy
}
{
Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / three
Memcheck:Param
write(buf)
obj:*/libpthread*.so
fun:my_write
fun:my_b_flush_io_cache
fun:_Z8filesortP3THDP8st_tableP13st_sort_fieldjP10SQL_SELECTybPy
}

View File

@ -61,10 +61,15 @@ Usage: $0 [OPTIONS]
--cross-bootstrap For internal use. Used when building the MySQL system
tables on a different host than the target.
--datadir=path The path to the MySQL data directory.
--defaults-extra-file=name
Read this file after the global files are read.
--defaults-file=name Only read default options from the given file name.
--force Causes mysql_install_db to run even if DNS does not
work. In that case, grant table entries that normally
use hostnames will use IP addresses.
--help Display this help and exit.
--ldata=path The path to the MySQL data directory. Same as --datadir.
--no-defaults Don't read default options from any option file.
--rpm For internal use. This option is used by RPM files
during the MySQL installation process.
--skip-name-resolve Use IP addresses rather than hostnames when creating

View File

@ -46,10 +46,15 @@ Usage: $0 [OPTIONS]
--cross-bootstrap For internal use. Used when building the MySQL system
tables on a different host than the target.
--datadir=path The path to the MySQL data directory.
--defaults-extra-file=name
Read this file after the global files are read.
--defaults-file=name Only read default options from the given file name.
--force Causes mysql_install_db to run even if DNS does not
work. In that case, grant table entries that normally
use hostnames will use IP addresses.
--help Display this help and exit.
--ldata=path The path to the MySQL data directory. Same as --datadir.
--no-defaults Don't read default options from any option file.
--rpm For internal use. This option is used by RPM files
during the MySQL installation process.
--skip-name-resolve Use IP addresses rather than hostnames when creating

View File

@ -144,8 +144,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
error= 1;
bzero((char*) &param,sizeof(param));
param.sort_length= sortlength(thd, sortorder, s_length, &multi_byte_charset);
/* filesort cannot handle zero-length records. */
DBUG_ASSERT(param.sort_length);
param.ref_length= table->file->ref_length;
param.addon_field= 0;
param.addon_length= 0;
@ -257,6 +255,9 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
}
else
{
/* filesort cannot handle zero-length records during merge. */
DBUG_ASSERT(param.sort_length != 0);
if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer)
{
x_free(table_sort.buffpek);
@ -959,21 +960,10 @@ static void make_sortkey(register SORTPARAM *param,
if (addonf->null_bit && field->is_null())
{
nulls[addonf->null_offset]|= addonf->null_bit;
#ifdef HAVE_purify
bzero(to, addonf->length);
#endif
}
else
{
#ifdef HAVE_purify
uchar *end= field->pack(to, field->ptr);
uint length= (uint) ((to + addonf->length) - end);
DBUG_ASSERT((int) length >= 0);
if (length)
bzero(end, length);
#else
(void) field->pack(to, field->ptr);
#endif
}
to+= addonf->length;
}

View File

@ -1679,7 +1679,7 @@ subselect_single_select_engine(st_select_lex *select,
select_subselect *result_arg,
Item_subselect *item_arg)
:subselect_engine(item_arg, result_arg),
prepared(0), optimized(0), executed(0),
prepared(0), optimized(0), executed(0), optimize_error(0),
select_lex(select), join(0)
{
select_lex->master_unit()->item= item_arg;
@ -1689,7 +1689,7 @@ subselect_single_select_engine(st_select_lex *select,
void subselect_single_select_engine::cleanup()
{
DBUG_ENTER("subselect_single_select_engine::cleanup");
prepared= optimized= executed= 0;
prepared= optimized= executed= optimize_error= 0;
join= 0;
result->cleanup();
DBUG_VOID_RETURN;
@ -1885,6 +1885,10 @@ int join_read_next_same_or_null(READ_RECORD *info);
int subselect_single_select_engine::exec()
{
DBUG_ENTER("subselect_single_select_engine::exec");
if (optimize_error)
DBUG_RETURN(1);
char const *save_where= thd->where;
SELECT_LEX *save_select= thd->lex->current_select;
thd->lex->current_select= select_lex;
@ -1892,12 +1896,15 @@ int subselect_single_select_engine::exec()
{
SELECT_LEX_UNIT *unit= select_lex->master_unit();
DBUG_EXECUTE_IF("bug11747970_simulate_error",
DBUG_SET("+d,bug11747970_raise_error"););
optimized= 1;
unit->set_limit(unit->global_parameters);
if (join->optimize())
{
thd->where= save_where;
executed= 1;
optimize_error= 1;
thd->lex->current_select= save_select;
DBUG_RETURN(join->error ? join->error : 1);
}

View File

@ -419,6 +419,7 @@ class subselect_single_select_engine: public subselect_engine
my_bool prepared; /* simple subselect is prepared */
my_bool optimized; /* simple subselect is optimized */
my_bool executed; /* simple subselect is executed */
my_bool optimize_error; ///< simple subselect optimization failed
st_select_lex *select_lex; /* corresponding select_lex */
JOIN * join; /* corresponding JOIN structure */
public:

View File

@ -101,12 +101,8 @@ public:
{
len= DECIMAL_BUFF_LENGTH;
buf= buffer;
#if !defined (HAVE_purify) && !defined(DBUG_OFF)
/* Set buffer to 'random' value to find wrong buffer usage */
for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++)
buffer[i]= i;
#endif
}
my_decimal()
{
init();

View File

@ -221,7 +221,13 @@ public:
#endif
/* if not set, the value of other members of the structure are undefined */
bool inited;
/*
inited changes its value within LOCK_active_mi-guarded critical
sections at times of start_slave_threads() (0->1) and end_slave() (1->0).
Readers may not acquire the mutex while they realize potential concurrency
issue.
*/
volatile bool inited;
volatile bool abort_slave;
volatile uint slave_running;

View File

@ -2494,10 +2494,10 @@ ER_TOO_BIG_SELECT 42000
cze "Zadan-Bý SELECT by procházel pøíli¹ mnoho záznamù a trval velmi dlouho. Zkontrolujte tvar WHERE a je-li SELECT v poøádku, pou¾ijte SET SQL_BIG_SELECTS=1"
dan "SELECT ville undersøge for mange poster og ville sandsynligvis tage meget lang tid. Undersøg WHERE delen og brug SET SQL_BIG_SELECTS=1 hvis udtrykket er korrekt"
nla "Het SELECT-statement zou te veel records analyseren en dus veel tijd in beslagnemen. Kijk het WHERE-gedeelte van de query na en kies SET SQL_BIG_SELECTS=1 als het stament in orde is."
eng "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay"
eng "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay"
est "SELECT lause peab läbi vaatama suure hulga kirjeid ja võtaks tõenäoliselt liiga kaua aega. Tasub kontrollida WHERE klauslit ja vajadusel kasutada käsku SET SQL_BIG_SELECTS=1"
fre "SELECT va devoir examiner beaucoup d'enregistrements ce qui va prendre du temps. Vérifiez la clause WHERE et utilisez SET SQL_BIG_SELECTS=1 si SELECT se passe bien"
ger "Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange dauern. Bitte WHERE-Klausel überprüfen und gegebenenfalls SET SQL_BIG_SELECTS=1 oder SET SQL_MAX_JOIN_SIZE=# verwenden"
ger "Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange dauern. Bitte WHERE-Klausel überprüfen und gegebenenfalls SET SQL_BIG_SELECTS=1 oder SET MAX_JOIN_SIZE=# verwenden"
greek "Ôï SELECT èá åîåôÜóåé ìåãÜëï áñéèìü åããñáöþí êáé ðéèáíþò èá êáèõóôåñÞóåé. Ðáñáêáëþ åîåôÜóôå ôéò ðáñáìÝôñïõò ôïõ WHERE êáé ÷ñçóéìïðïéåßóôå SET SQL_BIG_SELECTS=1 áí ôï SELECT åßíáé óùóôü"
hun "A SELECT tul sok rekordot fog megvizsgalni es nagyon sokaig fog tartani. Ellenorizze a WHERE-t es hasznalja a SET SQL_BIG_SELECTS=1 beallitast, ha a SELECT okay"
ita "La SELECT dovrebbe esaminare troppi record e usare troppo tempo. Controllare la WHERE e usa SET SQL_BIG_SELECTS=1 se e` tutto a posto."

View File

@ -598,11 +598,15 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock,
DBUG_PRINT("sleep",("Waiting for slave thread to start"));
const char* old_msg = thd->enter_cond(start_cond,cond_lock,
"Waiting for slave thread to start");
pthread_cond_wait(start_cond,cond_lock);
pthread_cond_wait(start_cond, cond_lock);
thd->exit_cond(old_msg);
pthread_mutex_lock(cond_lock); // re-acquire it as exit_cond() released
if (thd->killed)
{
if (start_lock)
pthread_mutex_unlock(start_lock);
DBUG_RETURN(thd->killed_errno());
}
}
}
if (start_lock)
@ -2531,6 +2535,7 @@ pthread_handler_t handle_slave_io(void *arg)
thd= new THD; // note that contructor of THD uses DBUG_ !
THD_CHECK_SENTRY(thd);
DBUG_ASSERT(mi->io_thd == 0);
mi->io_thd = thd;
pthread_detach_this_thread();
@ -4489,9 +4494,6 @@ int rotate_relay_log(Master_info* mi)
Relay_log_info* rli= &mi->rli;
int error= 0;
/* We don't lock rli->run_lock. This would lead to deadlocks. */
pthread_mutex_lock(&mi->run_lock);
/*
We need to test inited because otherwise, new_file() will attempt to lock
LOCK_log, which may not be inited (if we're not a slave).
@ -4521,7 +4523,6 @@ int rotate_relay_log(Master_info* mi)
*/
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
end:
pthread_mutex_unlock(&mi->run_lock);
DBUG_RETURN(error);
}

View File

@ -96,6 +96,13 @@ static TABLE_SHARE *oldest_unused_share, end_of_unused_share;
static pthread_mutex_t LOCK_table_share;
static bool table_def_inited= 0;
/**
Dummy TABLE instance which is used in reopen_tables() and reattach_merge()
functions to mark MERGE tables and their children with which there is some
kind of problem and which therefore we need to close.
*/
static TABLE bad_merge_marker;
static int open_unireg_entry(THD *thd, TABLE *entry, TABLE_LIST *table_list,
const char *alias,
char *cache_key, uint cache_key_length,
@ -3214,47 +3221,66 @@ void close_data_files_and_morph_locks(THD *thd, const char *db,
}
/**
@brief Mark merge parent and children with bad_merge_marker
@param[in,out] parent the TABLE object of the parent
*/
static void mark_merge_parent_and_children_as_bad(TABLE *parent)
{
TABLE_LIST *child_l;
DBUG_ENTER("mark_merge_parent_and_children_as_bad");
parent->parent= &bad_merge_marker;
for (child_l= parent->child_l; ; child_l= child_l->next_global)
{
child_l->table->parent= &bad_merge_marker;
child_l->table= NULL;
if (&child_l->next_global == parent->child_last_l)
break;
}
DBUG_VOID_RETURN;
}
/**
Reattach MERGE children after reopen.
@param[in] thd thread context
@param[in,out] err_tables_p pointer to pointer of tables in error
@note If reattach failed for certain MERGE table, the table (and all
it's children) are marked with bad_merge_marker.
@return status
@retval FALSE OK, err_tables_p unchanged
@retval TRUE Error, err_tables_p contains table(s)
@retval FALSE OK
@retval TRUE Error
*/
static bool reattach_merge(THD *thd, TABLE **err_tables_p)
static bool reattach_merge(THD *thd)
{
TABLE *table;
TABLE *next;
TABLE **prv_p= &thd->open_tables;
bool error= FALSE;
DBUG_ENTER("reattach_merge");
for (table= thd->open_tables; table; table= next)
for (table= thd->open_tables; table; table= table->next)
{
next= table->next;
DBUG_PRINT("tcache", ("check table: '%s'.'%s' 0x%lx next: 0x%lx",
DBUG_PRINT("tcache", ("check table: '%s'.'%s' 0x%lx",
table->s->db.str, table->s->table_name.str,
(long) table, (long) next));
/* Reattach children for MERGE tables with "closed data files" only. */
if (table->child_l && !table->children_attached)
(long) table));
/*
Reattach children only for MERGE tables that had children or parent
with "closed data files" and were reopen. For extra safety skip MERGE
tables which we failed to reopen (should not happen with current code).
*/
if (table->child_l && table->parent != &bad_merge_marker &&
!table->children_attached)
{
DBUG_PRINT("tcache", ("MERGE parent, attach children"));
if(table->file->extra(HA_EXTRA_ATTACH_CHILDREN))
if (table->file->extra(HA_EXTRA_ATTACH_CHILDREN))
{
my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias);
error= TRUE;
/* Remove table from open_tables. */
*prv_p= next;
if (next)
prv_p= &next->next;
/* Stack table on error list. */
table->next= *err_tables_p;
*err_tables_p= table;
continue;
mark_merge_parent_and_children_as_bad(table);
}
else
{
@ -3264,7 +3290,6 @@ static bool reattach_merge(THD *thd, TABLE **err_tables_p)
table->s->table_name.str, (long) table));
}
}
prv_p= &table->next;
}
DBUG_RETURN(error);
}
@ -3294,7 +3319,6 @@ bool reopen_tables(THD *thd, bool get_locks, bool mark_share_as_old)
{
TABLE *table,*next,**prev;
TABLE **tables,**tables_ptr; // For locks
TABLE *err_tables= NULL;
bool error=0, not_used;
bool merge_table_found= FALSE;
const uint flags= MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN |
@ -3328,29 +3352,69 @@ bool reopen_tables(THD *thd, bool get_locks, bool mark_share_as_old)
for (table=thd->open_tables; table ; table=next)
{
uint db_stat=table->db_stat;
TABLE *parent= table->child_l ? table : table->parent;
next=table->next;
DBUG_PRINT("tcache", ("open table: '%s'.'%s' 0x%lx "
"parent: 0x%lx db_stat: %u",
table->s->db.str, table->s->table_name.str,
(long) table, (long) table->parent, db_stat));
if (table->child_l && !db_stat)
/*
If we need to reopen child or parent table in a MERGE table, then
children in this MERGE table has to be already detached at this
point.
*/
DBUG_ASSERT(db_stat || !parent || !parent->children_attached);
/*
Thanks to the above assumption the below condition will guarantee that
merge_table_found is TRUE when we need to reopen child or parent table.
Note that it works even in situation when it is only a child and not a
parent that needs reopen (this can happen when get_locks == FALSE).
*/
if (table->child_l && !table->children_attached)
merge_table_found= TRUE;
if (!tables || (!db_stat && reopen_table(table)))
if (!tables)
{
my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias);
/*
If we could not allocate 'tables', we may close open tables
here. If a MERGE table is affected, detach the children first.
It is not necessary to clear the child or parent table reference
of this table because the TABLE is freed. But we need to clear
the child or parent references of the other belonging tables so
that they cannot be moved into the unused_tables chain with
these pointers set.
If we could not allocate 'tables' we close ALL open tables here.
Before closing MERGE child or parent we need to detach children
and/or clear references in/to them.
*/
if (table->child_l || table->parent)
if (parent)
detach_merge_children(table, TRUE);
VOID(hash_delete(&open_cache,(uchar*) table));
error=1;
}
else if (table->parent == &bad_merge_marker)
{
/*
This is either a child or a parent of a MERGE table for which
we already decided that we are unable to reopen it. Close it.
Reset parent reference, it may be used while freeing the table.
*/
table->parent= NULL;
}
else if (!db_stat && reopen_table(table))
{
/*
If we fail to reopen a child or a parent in a MERGE table and the
MERGE table is affected for the first time, mark all relevant tables
invalid. Otherwise handle it as usual.
All in all we must end up with:
- child tables are detached from parent. This was done earlier,
but child<->parent references were kept valid for reopen.
- parent is not in the to-be-locked tables
- all child tables and parent are not in the THD::open_tables.
- all child tables and parent are not in the open_cache.
Please note that below we do additional pass through THD::open_tables
list to achieve the last three points.
*/
if (parent)
{
mark_merge_parent_and_children_as_bad(parent);
table->parent= NULL;
}
}
else
{
@ -3366,21 +3430,56 @@ bool reopen_tables(THD *thd, bool get_locks, bool mark_share_as_old)
table->s->version=0;
table->open_placeholder= 0;
}
continue;
}
my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias);
VOID(hash_delete(&open_cache, (uchar *) table));
error= 1;
}
*prev=0;
/*
When all tables are open again, we can re-attach MERGE children to
their parents. All TABLE objects are still present.
their parents.
If there was an error while reopening a child or a parent of a MERGE
table, or while reattaching child tables to their parents, some tables
may have been kept open but marked for close with bad_merge_marker.
Close these tables now.
*/
DBUG_PRINT("tcache", ("re-attaching MERGE tables: %d", merge_table_found));
if (!error && merge_table_found && reattach_merge(thd, &err_tables))
if (tables && merge_table_found && (error|= reattach_merge(thd)))
{
while (err_tables)
prev= &thd->open_tables;
for (table= thd->open_tables; table; table= next)
{
VOID(hash_delete(&open_cache, (uchar*) err_tables));
err_tables= err_tables->next;
next= table->next;
if (table->parent == &bad_merge_marker)
{
/* Remove merge parent from to-be-locked tables array. */
if (get_locks && table->child_l)
{
TABLE **t;
for (t= tables; t < tables_ptr; t++)
{
if (*t == table)
{
tables_ptr--;
memmove(t, t + 1, (tables_ptr - t) * sizeof(TABLE *));
break;
}
}
}
/* Reset parent reference, it may be used while freeing the table. */
table->parent= NULL;
/* Free table. */
VOID(hash_delete(&open_cache, (uchar *) table));
}
else
{
*prev= table;
prev= &table->next;
}
}
*prev= 0;
}
DBUG_PRINT("tcache", ("open tables to lock: %u",
(uint) (tables_ptr - tables)));

View File

@ -2641,6 +2641,12 @@ mysql_execute_command(THD *thd)
create_table->table_name))
goto end_with_restore_list;
#endif
/*
If no engine type was given, work out the default now
rather than at parse-time.
*/
if (!(create_info.used_fields & HA_CREATE_USED_ENGINE))
create_info.db_type= ha_default_handlerton(thd);
/*
If we are using SET CHARSET without DEFAULT, add an implicit
DEFAULT to not confuse old users. (This may change).

View File

@ -2677,6 +2677,16 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
table_vector[i]=s->table=table=tables->table;
table->pos_in_table_list= tables;
error= table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
DBUG_EXECUTE_IF("bug11747970_raise_error",
{
if (!error)
{
my_error(ER_UNKNOWN_ERROR, MYF(0));
goto error;
}
});
if (error)
{
table->file->print_error(error, MYF(0));

Some files were not shown because too many files have changed in this diff Show More