mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge from mysql-next-mr
This commit is contained in:
@ -1615,7 +1615,7 @@ DROP TABLE t1;
|
||||
# BUG#46961 - archive engine loses rows during self joining select!
|
||||
#
|
||||
SET @save_join_buffer_size= @@join_buffer_size;
|
||||
SET @@join_buffer_size= 8228;
|
||||
SET @@join_buffer_size= 8192;
|
||||
CREATE TABLE t1(a CHAR(255)) ENGINE=archive;
|
||||
INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
|
||||
('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
|
||||
|
@ -1 +1 @@
|
||||
--skip-grant-tables --skip-name-resolve --safemalloc-mem-limit=4000000
|
||||
--skip-grant-tables --skip-name-resolve --loose-safemalloc-mem-limit=4000000
|
||||
|
@ -3,6 +3,8 @@
|
||||
--echo # sort_buffer_size cannot allocate
|
||||
--echo #
|
||||
|
||||
--source include/have_debug.inc
|
||||
|
||||
call mtr.add_suppression("Out of memory at line .*, 'my_alloc.c'");
|
||||
call mtr.add_suppression("needed .* byte .*k., memory in use: .* bytes .*k");
|
||||
|
||||
|
@ -177,8 +177,6 @@ select cast(1.0e+300 as signed int);
|
||||
CREATE TABLE t1 (f1 double);
|
||||
INSERT INTO t1 SET f1 = -1.0e+30 ;
|
||||
INSERT INTO t1 SET f1 = +1.0e+30 ;
|
||||
# Expected result is +-1e+30, but Windows returns +-1e+030.
|
||||
--replace_result 1e+030 1e+30
|
||||
SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
@ -20,7 +20,7 @@ SET @@session.max_join_size = default;
|
||||
SELECT @@session.sql_big_selects;
|
||||
# On some machines the following will result into a warning
|
||||
--disable_warnings
|
||||
SET @@global.max_join_size = -1;
|
||||
SET @@global.max_join_size = 18446744073709551615;
|
||||
--enable_warnings
|
||||
SET @@session.max_join_size = default;
|
||||
--echo change_user
|
||||
|
@ -16,83 +16,78 @@ FROM information_schema.session_variables
|
||||
WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
|
||||
ORDER BY variable_name;
|
||||
|
||||
#
|
||||
# Test setting a lot of different formats to see which formats are accepted and
|
||||
# which aren't
|
||||
#
|
||||
|
||||
SET time_format='%H%i%s';
|
||||
SET time_format='%H:%i:%s.%f';
|
||||
SET time_format='%h-%i-%s.%f%p';
|
||||
SET time_format='%h:%i:%s.%f %p';
|
||||
SET time_format='%h:%i:%s%p';
|
||||
|
||||
SET date_format='%Y%m%d';
|
||||
SET date_format='%Y.%m.%d';
|
||||
SET date_format='%d.%m.%Y';
|
||||
SET date_format='%m-%d-%Y';
|
||||
|
||||
set datetime_format= '%Y%m%d%H%i%s';
|
||||
set datetime_format= '%Y-%m-%d %H:%i:%s';
|
||||
set datetime_format= '%m-%d-%y %H:%i:%s.%f';
|
||||
set datetime_format= '%d-%m-%Y %h:%i:%s%p';
|
||||
set datetime_format= '%H:%i:%s %Y-%m-%d';
|
||||
set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
|
||||
set datetime_format= '%h:%i:%s %p %Y-%m-%d';
|
||||
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
|
||||
|
||||
SELECT variable_name, variable_value
|
||||
FROM information_schema.session_variables
|
||||
WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
|
||||
ORDER BY variable_name;
|
||||
|
||||
--error 1231
|
||||
SET time_format='%h:%i:%s';
|
||||
--error 1231
|
||||
SET time_format='%H %i:%s';
|
||||
--error 1231
|
||||
SET time_format='%H::%i:%s';
|
||||
--error 1231
|
||||
SET time_format='%H:%i:%s%f';
|
||||
--error 1231
|
||||
SET time_format='%H:%i.%f:%s';
|
||||
--error 1231
|
||||
SET time_format='%H:%i:%s%p';
|
||||
--error 1231
|
||||
SET time_format='%h:%i:%s.%f %p %Y-%m-%d';
|
||||
--error 1231
|
||||
SET time_format='%H%i%s.%f';
|
||||
--error 1231
|
||||
SET time_format='%H:%i-%s.%f';
|
||||
--error 1231
|
||||
SET date_format='%d.%m.%d';
|
||||
--error 1231
|
||||
SET datetime_format='%h.%m.%y %d.%i.%s';
|
||||
--error 1231
|
||||
set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d';
|
||||
|
||||
#
|
||||
# Test GLOBAL values
|
||||
|
||||
set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d';
|
||||
SET SESSION datetime_format=default;
|
||||
select @@global.datetime_format, @@session.datetime_format;
|
||||
SET GLOBAL datetime_format=default;
|
||||
SET SESSION datetime_format=default;
|
||||
select @@global.datetime_format, @@session.datetime_format;
|
||||
|
||||
SET GLOBAL date_format=default;
|
||||
SET GLOBAL time_format=default;
|
||||
SET GLOBAL datetime_format=default;
|
||||
SET time_format=default;
|
||||
SET date_format=default;
|
||||
SET datetime_format=default;
|
||||
|
||||
#
|
||||
# The following tests will work only when we at some point will enable
|
||||
# dynamic changing of formats
|
||||
#
|
||||
|
||||
# SET time_format='%H%i%s';
|
||||
# SET time_format='%H:%i:%s.%f';
|
||||
# SET time_format='%h-%i-%s.%f%p';
|
||||
# SET time_format='%h:%i:%s.%f %p';
|
||||
# SET time_format='%h:%i:%s%p';
|
||||
#
|
||||
# SET date_format='%Y%m%d';
|
||||
# SET date_format='%Y.%m.%d';
|
||||
# SET date_format='%d.%m.%Y';
|
||||
# SET date_format='%m-%d-%Y';
|
||||
#
|
||||
# set datetime_format= '%Y%m%d%H%i%s';
|
||||
# set datetime_format= '%Y-%m-%d %H:%i:%s';
|
||||
# set datetime_format= '%m-%d-%y %H:%i:%s.%f';
|
||||
# set datetime_format= '%d-%m-%Y %h:%i:%s%p';
|
||||
# set datetime_format= '%H:%i:%s %Y-%m-%d';
|
||||
# set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
|
||||
# set datetime_format= '%h:%i:%s %p %Y-%m-%d';
|
||||
# set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
|
||||
#
|
||||
# SELECT variable_name, variable_value
|
||||
# FROM information_schema.session_variables
|
||||
# WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
|
||||
# ORDER BY variable_name;
|
||||
#
|
||||
# --error 1231
|
||||
# SET time_format='%h:%i:%s';
|
||||
# --error 1231
|
||||
# SET time_format='%H %i:%s';
|
||||
# --error 1231
|
||||
# SET time_format='%H::%i:%s';
|
||||
# --error 1231
|
||||
# SET time_format='%H:%i:%s%f';
|
||||
# --error 1231
|
||||
# SET time_format='%H:%i.%f:%s';
|
||||
# --error 1231
|
||||
# SET time_format='%H:%i:%s%p';
|
||||
# --error 1231
|
||||
# SET time_format='%h:%i:%s.%f %p %Y-%m-%d';
|
||||
# --error 1231
|
||||
# SET time_format='%H%i%s.%f';
|
||||
# --error 1231
|
||||
# SET time_format='%H:%i-%s.%f';
|
||||
# --error 1231
|
||||
# SET date_format='%d.%m.%d';
|
||||
# --error 1231
|
||||
# SET datetime_format='%h.%m.%y %d.%i.%s';
|
||||
# --error 1231
|
||||
# set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d';
|
||||
#
|
||||
# #
|
||||
# # Test GLOBAL values
|
||||
#
|
||||
# set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d';
|
||||
# SET SESSION datetime_format=default;
|
||||
# select @@global.datetime_format, @@session.datetime_format;
|
||||
# SET GLOBAL datetime_format=default;
|
||||
# SET SESSION datetime_format=default;
|
||||
# select @@global.datetime_format, @@session.datetime_format;
|
||||
#
|
||||
# SET GLOBAL date_format=default;
|
||||
# SET GLOBAL time_format=default;
|
||||
# SET GLOBAL datetime_format=default;
|
||||
# SET time_format=default;
|
||||
# SET date_format=default;
|
||||
# SET datetime_format=default;
|
||||
|
||||
# SET date_format='%d.%m.%Y';
|
||||
# select CAST('01.01.2001' as DATE) as a;
|
||||
# SET datetime_format='%d.%m.%Y %H.%i.%s';
|
||||
|
@ -148,7 +148,7 @@ set names koi8r|
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.views.mysqltest1.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $views_dump1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $views_dump1
|
||||
|
||||
# - Clean mysqltest1;
|
||||
|
||||
@ -408,22 +408,22 @@ set names koi8r|
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest1
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 > $sp_dump1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1 > $sp_dump1
|
||||
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest2
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 > $sp_dump2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2 > $sp_dump2
|
||||
|
||||
# - Clean mysqltest1, mysqltest2;
|
||||
|
||||
@ -685,22 +685,22 @@ use mysqltest1|
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest1
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 > $triggers_dump1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1 > $triggers_dump1
|
||||
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest2
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 > $triggers_dump2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2 > $triggers_dump2
|
||||
|
||||
# - Clean mysqltest1, mysqltest2;
|
||||
|
||||
@ -946,22 +946,22 @@ set names koi8r|
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest1
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.events.mysqltest1.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 > $events_dump1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1 > $events_dump1
|
||||
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest2
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.events.mysqltest2.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 > $events_dump2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2 > $events_dump2
|
||||
|
||||
# - Clean mysqltest1, mysqltest2;
|
||||
|
||||
|
@ -148,7 +148,7 @@ set names utf8|
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8views.mysqltest1.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $views_dump1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $views_dump1
|
||||
|
||||
# - Clean mysqltest1;
|
||||
|
||||
@ -408,22 +408,22 @@ set names utf8|
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest1
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 > $sp_dump1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1 > $sp_dump1
|
||||
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest2
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 > $sp_dump2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2 > $sp_dump2
|
||||
|
||||
# - Clean mysqltest1, mysqltest2;
|
||||
|
||||
@ -685,22 +685,22 @@ use mysqltest1|
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest1
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 > $triggers_dump1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1 > $triggers_dump1
|
||||
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest2
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 > $triggers_dump2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2 > $triggers_dump2
|
||||
|
||||
# - Clean mysqltest1, mysqltest2;
|
||||
|
||||
@ -946,22 +946,22 @@ set names utf8|
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest1
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8events.mysqltest1.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 > $events_dump1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1 > $events_dump1
|
||||
|
||||
--echo
|
||||
--echo ---> Dump of mysqltest2
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2
|
||||
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8events.mysqltest2.sql
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 > $events_dump2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2 > $events_dump2
|
||||
|
||||
# - Clean mysqltest1, mysqltest2;
|
||||
|
||||
|
@ -13,3 +13,4 @@ kill : Bug#37780 2008-12-03 HHunger need some changes to be
|
||||
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadicallyr
|
||||
innodb-autoinc : Bug#49267 2009-12-02 test fails on windows because of different case mode
|
||||
innodb : Bug#49396 2009-12-03 test fails in embedded mode
|
||||
plugin_load : Bug#42144 2009-12-21 alik plugin_load fails
|
||||
|
@ -102,8 +102,11 @@ drop table t1;
|
||||
drop table t2;
|
||||
drop function f1;
|
||||
drop function f2;
|
||||
|
||||
#
|
||||
# testing the value encoding in the error messages of set_var
|
||||
# testing the value encoding in the error messages
|
||||
#
|
||||
# should be TR\xC3\x9CE, TR<54>E, TR<54>E
|
||||
#
|
||||
SET NAMES utf8;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
@ -125,9 +128,9 @@ SET sql_quote_show_create= _utf8 x'5452C39C45';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
SET sql_quote_show_create=_latin1 x'5452DC45';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
SET sql_quote_show_create='TR.E';
|
||||
SET sql_quote_show_create='TR<EFBFBD>E';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
SET sql_quote_show_create=TR.E;
|
||||
SET sql_quote_show_create=TR<EFBFBD>E;
|
||||
|
||||
SET NAMES binary;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
@ -136,3 +139,4 @@ SET sql_quote_show_create= _binary x'5452C39C45';
|
||||
SET sql_quote_show_create= _utf8 x'5452C39C45';
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
SET sql_quote_show_create=_latin1 x'5452DC45';
|
||||
|
||||
|
@ -25,15 +25,6 @@ set names utf8;
|
||||
create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1;
|
||||
drop event задачка;
|
||||
|
||||
# event_scheduler is a global var
|
||||
--error ER_GLOBAL_VARIABLE
|
||||
set event_scheduler=off;
|
||||
# event_scheduler could be only either 1 or 2
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global event_scheduler=3;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global event_scheduler=disabled;
|
||||
|
||||
--echo "DISABLE the scheduler. Testing that it does not work when the variable is 0"
|
||||
set global event_scheduler=off;
|
||||
select definer, name, db from mysql.event;
|
||||
|
@ -1199,14 +1199,14 @@ DROP USER mysqltest_u1@localhost;
|
||||
drop procedure if exists p;
|
||||
--enable_warnings
|
||||
set @old_mode= @@sql_mode;
|
||||
set @@sql_mode= pow(2,32)-1;
|
||||
set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
|
||||
create event e1 on schedule every 1 day do select 1;
|
||||
select @@sql_mode;
|
||||
select @@sql_mode into @full_mode;
|
||||
set @@sql_mode= @old_mode;
|
||||
# Rename SQL modes that differ in name between the server and the table definition.
|
||||
select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
|
||||
select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode;
|
||||
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
|
||||
select name from mysql.event where name = 'p' and sql_mode = @full_mode;
|
||||
select name from mysql.event where name = 'e1' and sql_mode = @full_mode;
|
||||
drop event e1;
|
||||
|
||||
#
|
||||
|
@ -1,22 +0,0 @@
|
||||
#
|
||||
# Simple test for the example storage engine
|
||||
# Taken fromm the select test
|
||||
#
|
||||
-- source include/have_exampledb.inc
|
||||
|
||||
--disable_warnings
|
||||
# Clean up if event's test fails
|
||||
drop database if exists events_test;
|
||||
drop database if exists events_test2;
|
||||
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (
|
||||
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
|
||||
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
|
||||
) ENGINE=example;
|
||||
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
@ -353,6 +353,9 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
|
||||
36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439
|
||||
36.252666,-115.261439 36.247366,-115.247239 36.247066)))'));
|
||||
|
||||
# Expected result is 115.31877315203187, but IA64 returns 115.31877315203188
|
||||
# due to fused multiply-add instructions.
|
||||
--replace_result 115.31877315203188 115.31877315203187
|
||||
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
|
||||
t1 where object_id=85998;
|
||||
|
||||
|
@ -36,7 +36,6 @@ select @@optimizer_switch;
|
||||
set optimizer_switch='default,index_merge_sort_union=off';
|
||||
select @@optimizer_switch;
|
||||
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set optimizer_switch=4;
|
||||
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_commit_concurrency=0;
|
||||
select @@innodb_commit_concurrency;
|
||||
set global innodb_commit_concurrency=1;
|
||||
@ -14,7 +14,7 @@ set global innodb_commit_concurrency=42;
|
||||
select @@innodb_commit_concurrency;
|
||||
set global innodb_commit_concurrency=DEFAULT;
|
||||
select @@innodb_commit_concurrency;
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_commit_concurrency=0;
|
||||
select @@innodb_commit_concurrency;
|
||||
set global innodb_commit_concurrency=1;
|
||||
|
@ -7,10 +7,10 @@
|
||||
|
||||
set global innodb_commit_concurrency=0;
|
||||
select @@innodb_commit_concurrency;
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_commit_concurrency=1;
|
||||
select @@innodb_commit_concurrency;
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_commit_concurrency=42;
|
||||
select @@innodb_commit_concurrency;
|
||||
set global innodb_commit_concurrency=0;
|
||||
|
@ -422,9 +422,6 @@ INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
|
||||
INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
|
||||
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
|
||||
# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and
|
||||
# "1.3e+78" due to different rounding rules
|
||||
--replace_result 12.3 12.2 1.3e+78 1.2e+78
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
@ -459,9 +456,6 @@ INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
|
||||
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
|
||||
|
||||
# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and
|
||||
# "1.3e+78" due to different rounding rules
|
||||
--replace_result 12.3 12.2 1.3e+78 1.2e+78
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
@ -149,10 +149,13 @@ show status like 'key_blocks_used';
|
||||
--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED
|
||||
show status like 'key_blocks_unused';
|
||||
|
||||
|
||||
# Cleanup
|
||||
# We don't reset keycache2 as we want to ensure that mysqld will reset it
|
||||
create table t1 (a int primary key);
|
||||
cache index t1 in keycache2;
|
||||
insert t1 values (1),(2),(3),(4),(5),(6),(7),(8);
|
||||
# delete keycache2, t1 is reassigned to default
|
||||
set global keycache2.key_buffer_size=0;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# Test to set up a too small size for a key cache (bug #2064)
|
||||
set global keycache3.key_buffer_size=100;
|
||||
@ -216,6 +219,7 @@ set global key_cache_block_size= @my_key_cache_block_size;
|
||||
# Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO
|
||||
# (One cannot drop the default key cache.)
|
||||
#
|
||||
--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
|
||||
set @@global.key_buffer_size=0;
|
||||
select @@global.key_buffer_size;
|
||||
|
||||
|
1
mysql-test/t/mysql-bug45236-master.opt
Normal file
1
mysql-test/t/mysql-bug45236-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--loose-skip-safemalloc
|
@ -128,10 +128,10 @@ DROP DATABASE IF EXISTS `ó`;
|
||||
#
|
||||
--echo
|
||||
--echo iso88592
|
||||
--exec LC_ALL=cs_CZ.iso88592 $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client"
|
||||
--exec LC_ALL=cs_CZ.iso88592 $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
|
||||
--exec LC_ALL=cs_CZ.iso88592 $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó
|
||||
--exec LC_ALL=cs_CZ.iso88592 $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR--default-character-set=auto "ó"
|
||||
--exec LC_ALL=cs_CZ.iso88592 $MYSQL --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto test -e "SELECT @@character_set_client"
|
||||
--exec LC_ALL=cs_CZ.iso88592 $MYSQLADMIN --character-sets-dir=$MYSQL_SHAREDIR/charsets -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
|
||||
--exec LC_ALL=cs_CZ.iso88592 $MYSQL_SHOW --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto ó
|
||||
--exec LC_ALL=cs_CZ.iso88592 $MYSQL_CHECK --character-sets-dir=$MYSQL_SHAREDIR/charsets--default-character-set=auto "ó"
|
||||
|
||||
|
||||
# {"iso88597", "greek", my_cs_exact},
|
||||
@ -163,10 +163,10 @@ DROP DATABASE IF EXISTS `ó`;
|
||||
|
||||
--echo
|
||||
--echo koi8r
|
||||
--exec LC_ALL=ru_RU.koi8r $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client"
|
||||
--exec LC_ALL=ru_RU.koi8r $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
|
||||
--exec LC_ALL=ru_RU.koi8r $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó
|
||||
--exec LC_ALL=ru_RU.koi8r $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR --default-character-set=auto "ó"
|
||||
--exec LC_ALL=ru_RU.koi8r $MYSQL --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto test -e "SELECT @@character_set_client"
|
||||
--exec LC_ALL=ru_RU.koi8r $MYSQLADMIN --character-sets-dir=$MYSQL_SHAREDIR/charsets -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
|
||||
--exec LC_ALL=ru_RU.koi8r $MYSQL_SHOW --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto ó
|
||||
--exec LC_ALL=ru_RU.koi8r $MYSQL_CHECK --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto "ó"
|
||||
|
||||
|
||||
# {"Shift_JIS", "sjis", my_cs_exact},
|
||||
|
8
mysql-test/t/mysqld--help-notwin.test
Normal file
8
mysql-test/t/mysqld--help-notwin.test
Normal file
@ -0,0 +1,8 @@
|
||||
#
|
||||
# mysqld --help
|
||||
#
|
||||
--source include/not_embedded.inc
|
||||
--source include/not_windows.inc
|
||||
|
||||
--source include/mysqld--help.inc
|
||||
|
8
mysql-test/t/mysqld--help-win.test
Normal file
8
mysql-test/t/mysqld--help-win.test
Normal file
@ -0,0 +1,8 @@
|
||||
#
|
||||
# mysqld --help
|
||||
#
|
||||
--source include/not_embedded.inc
|
||||
--source include/windows.inc
|
||||
|
||||
--source include/mysqld--help.inc
|
||||
|
@ -46,9 +46,6 @@ DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a double);
|
||||
INSERT INTO t1 VALUES ('-9e999999');
|
||||
# The following replaces is here because some systems replaces the above
|
||||
# double with '-inf' and others with MAX_DOUBLE
|
||||
--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
|
||||
--exec $MYSQL_DUMP --compact test t1
|
||||
DROP TABLE t1;
|
||||
|
||||
@ -168,7 +165,7 @@ drop database mysqldump_test_db;
|
||||
|
||||
CREATE TABLE t1 (a CHAR(10));
|
||||
INSERT INTO t1 VALUES (_latin1 '<27><><EFBFBD><EFBFBD>');
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments test t1
|
||||
|
||||
--echo #
|
||||
--echo # Bug#8063 make test mysqldump [ fail ]
|
||||
@ -178,10 +175,10 @@ INSERT INTO t1 VALUES (_latin1 '
|
||||
--echo # checking that "mysqldump" is compiled with "latin1"
|
||||
--echo #
|
||||
|
||||
#--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1
|
||||
#--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --compatible=mysql323 test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
@ -1673,14 +1670,14 @@ drop database db42635;
|
||||
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE `straße` ( f1 INT );
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=latin1 --compatible=mysql323 test
|
||||
DROP TABLE `straße`;
|
||||
|
||||
CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( f1 INT );
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=latin1 --compatible=mysql323 test
|
||||
DROP TABLE `כדשגכחךלדגכחשךדגחכךלדגכ`;
|
||||
SET NAMES latin1;
|
||||
|
||||
@ -1837,7 +1834,7 @@ set names latin1;
|
||||
--echo
|
||||
--echo # Dump mysqldump_test_db to bug30027.sql.
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30027.sql
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=latin1 --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30027.sql
|
||||
|
||||
--echo
|
||||
--echo # Drop mysqldump_test_db.
|
||||
@ -1923,7 +1920,7 @@ WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1';
|
||||
--echo
|
||||
|
||||
--echo ---> Dumping mysqldump_test_db to bug30217.sql
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30217.sql
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30217.sql
|
||||
|
||||
--echo
|
||||
|
||||
@ -2079,7 +2076,7 @@ INSERT INTO t1 VALUES (1, 'ABC-АБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
|
||||
|
||||
--echo # default '--default-charset' (binary):
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@ -2092,7 +2089,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
--echo # utf8:
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=utf8 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=utf8 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@ -2105,7 +2102,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
--echo # latin1 (data corruption is expected):
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=latin1 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
@ -2118,7 +2115,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||
|
||||
--echo # koi8r (data corruption is expected):
|
||||
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=koi8r --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=koi8r --tab=$MYSQLTEST_VARDIR/tmp/ test t1
|
||||
--echo ##################################################
|
||||
--cat_file $file
|
||||
--echo ##################################################
|
||||
|
@ -646,6 +646,10 @@ select conv(255 AS p1, 10 AS p2, 16 AS p3);
|
||||
|
||||
# Native function with a variable number of arguments
|
||||
|
||||
# Bug in libm.so on Solaris:
|
||||
# atan(10) from 32-bit version returns 1.4711276743037347
|
||||
# atan(10) from 64-bit version returns 1.4711276743037345
|
||||
--replace_result 1.4711276743037345 1.4711276743037347
|
||||
select atan(10);
|
||||
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
|
||||
select atan(10 AS p1);
|
||||
|
@ -23,6 +23,23 @@ partition by range columns (a,b,c)
|
||||
( partition p0 values less than (1, maxvalue, 10),
|
||||
partition p1 values less than (1, maxvalue, maxvalue));
|
||||
|
||||
#
|
||||
# BUG#48737, Search fails with ucs2
|
||||
#
|
||||
create table t1 (a varchar(5) character set ucs2 collate ucs2_bin)
|
||||
partition by range columns (a)
|
||||
(partition p0 values less than (0x0041));
|
||||
insert into t1 values (0x00410000);
|
||||
select hex(a) from t1 where a like 'A_';
|
||||
explain partitions select hex(a) from t1 where a like 'A_';
|
||||
alter table t1 remove partitioning;
|
||||
select hex(a) from t1 where a like 'A_';
|
||||
create index a on t1 (a);
|
||||
select hex(a) from t1 where a like 'A_';
|
||||
insert into t1 values ('A_');
|
||||
select hex(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#48161, Delivering too few records using collate syntax with partitions
|
||||
#
|
||||
|
251
mysql-test/t/partition_key_cache.test
Normal file
251
mysql-test/t/partition_key_cache.test
Normal file
@ -0,0 +1,251 @@
|
||||
# Test of key cache with partitions
|
||||
--source include/have_partition.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2, v, x;
|
||||
--enable_warnings
|
||||
|
||||
--echo # Actual test of key caches
|
||||
--echo # Verifing that reads/writes use the key cache correctly
|
||||
SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size;
|
||||
--echo # Minimize default key cache (almost disabled).
|
||||
SET @@global.default.key_buffer_size = 4096;
|
||||
CREATE TABLE t1 (
|
||||
a INT,
|
||||
b INT,
|
||||
c INT NOT NULL,
|
||||
PRIMARY KEY (a),
|
||||
KEY `inx_b` (b))
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY HASH (a)
|
||||
(PARTITION p0 VALUES LESS THAN (1167602410)
|
||||
(SUBPARTITION sp0,
|
||||
SUBPARTITION sp1),
|
||||
PARTITION p1 VALUES LESS THAN MAXVALUE
|
||||
(SUBPARTITION sp2,
|
||||
SUBPARTITION sp3));
|
||||
CREATE TABLE t2 (
|
||||
a INT,
|
||||
b INT,
|
||||
c INT NOT NULL,
|
||||
PRIMARY KEY (a),
|
||||
KEY `inx_b` (b));
|
||||
FLUSH TABLES;
|
||||
FLUSH STATUS;
|
||||
|
||||
# Genereate 4096 rows. Idea from:
|
||||
# http://datacharmer.blogspot.com/2007/12/data-from-nothing-solution-to-pop-quiz.html
|
||||
SET @a:=1167602400;
|
||||
CREATE VIEW v AS SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4;
|
||||
CREATE VIEW x AS SELECT 1 FROM v,v a,v b;
|
||||
# due to I_S performance, this was substituted with include files which
|
||||
# uses SHOW STATUS
|
||||
#DELIMITER |;
|
||||
#CREATE PROCEDURE was_zero_reads()
|
||||
#BEGIN
|
||||
# SELECT IF(VARIABLE_VALUE = 0,"Yes!","No!") as 'Was zero reads?'
|
||||
# FROM INFORMATION_SCHEMA.SESSION_STATUS
|
||||
# WHERE VARIABLE_NAME = 'KEY_READS';
|
||||
# FLUSH STATUS;
|
||||
#END|
|
||||
#DELIMITER ;|
|
||||
|
||||
FLUSH STATUS;
|
||||
INSERT t1 SELECT @a, @a * (1 - ((@a % 2) * 2)) , 1167612400 - (@a:=@a+1) FROM x, x y;
|
||||
--source include/check_key_req.inc
|
||||
--echo # row distribution:
|
||||
SELECT PARTITION_NAME, SUBPARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA='test' and TABLE_NAME='t1';
|
||||
DROP VIEW x;
|
||||
DROP VIEW v;
|
||||
FLUSH TABLES;
|
||||
FLUSH STATUS;
|
||||
SELECT COUNT(b) FROM t1 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
INSERT t2 SELECT a,b,c FROM t1;
|
||||
--source include/check_key_req.inc
|
||||
FLUSH STATUS;
|
||||
SELECT COUNT(b) FROM t2 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
FLUSH TABLES;
|
||||
--echo # Setting the default key cache to 1M
|
||||
SET GLOBAL key_buffer_size = 1024*1024;
|
||||
FLUSH STATUS;
|
||||
--echo # All these have to read the indexes
|
||||
LOAD INDEX INTO CACHE t1 PARTITION (p1);
|
||||
--source include/check_key_reads.inc
|
||||
SELECT COUNT(b) FROM t1 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
SELECT COUNT(b) FROM t2 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
--echo # All these should be able to use the key cache
|
||||
SELECT COUNT(b) FROM t1 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
SELECT COUNT(b) FROM t2 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
FLUSH TABLES;
|
||||
LOAD INDEX INTO CACHE t1 PARTITION (p1,p0);
|
||||
--source include/check_key_reads.inc
|
||||
--echo # should not be zero
|
||||
SELECT COUNT(b) FROM t1 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
LOAD INDEX INTO CACHE t2;
|
||||
--source include/check_key_reads.inc
|
||||
--echo # should not be zero
|
||||
SELECT COUNT(b) FROM t2 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
FLUSH TABLES;
|
||||
LOAD INDEX INTO CACHE t1 PARTITION (p1,p0) IGNORE LEAVES;
|
||||
--source include/check_key_reads.inc
|
||||
--echo # should not be zero
|
||||
SELECT COUNT(b) FROM t1 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
LOAD INDEX INTO CACHE t2 IGNORE LEAVES;
|
||||
--source include/check_key_reads.inc
|
||||
--echo # should not be zero
|
||||
SELECT COUNT(b) FROM t2 WHERE b >= 0;
|
||||
--source include/check_key_reads.inc
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT t2 SELECT a,b,c FROM t1;
|
||||
--source include/check_key_req.inc
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
SET GLOBAL hot_cache.key_buffer_size = 1024*1024;
|
||||
SET GLOBAL warm_cache.key_buffer_size = 1024*1024;
|
||||
SET @@global.cold_cache.key_buffer_size = 1024*1024;
|
||||
SELECT @@global.default.key_buffer_size a, @@global.default.key_cache_block_size b, @@global.default.key_cache_age_threshold c, @@global.default.key_cache_division_limit d;
|
||||
SELECT @@global.hot_cache.key_buffer_size a, @@global.hot_cache.key_cache_block_size b, @@global.hot_cache.key_cache_age_threshold c, @@global.hot_cache.key_cache_division_limit d;
|
||||
SELECT @@global.warm_cache.key_buffer_size a, @@global.warm_cache.key_cache_block_size b, @@global.warm_cache.key_cache_age_threshold c, @@global.warm_cache.key_cache_division_limit d;
|
||||
SELECT @@global.cold_cache.key_buffer_size a, @@global.cold_cache.key_cache_block_size b, @@global.cold_cache.key_cache_age_threshold c, @@global.cold_cache.key_cache_division_limit d;
|
||||
CREATE TABLE t1 (
|
||||
a INT,
|
||||
b VARCHAR(257),
|
||||
c INT NOT NULL,
|
||||
PRIMARY KEY (a),
|
||||
KEY `inx_b` (b),
|
||||
KEY `inx_c`(c))
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY HASH (a)
|
||||
(PARTITION p0 VALUES LESS THAN (10)
|
||||
(SUBPARTITION sp0,
|
||||
SUBPARTITION sp1),
|
||||
PARTITION p1 VALUES LESS THAN MAXVALUE
|
||||
(SUBPARTITION sp2,
|
||||
SUBPARTITION sp3));
|
||||
CREATE TABLE t2 (
|
||||
a INT,
|
||||
b VARCHAR(257),
|
||||
c INT NOT NULL,
|
||||
PRIMARY KEY (a),
|
||||
KEY `inx_b` (b),
|
||||
KEY `inx_c`(c));
|
||||
SET @a:=1167602400;
|
||||
# Genereate 4096 rows. Idea from:
|
||||
# http://datacharmer.blogspot.com/2007/12/data-from-nothing-solution-to-pop-quiz.html
|
||||
CREATE VIEW v AS SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4;
|
||||
CREATE VIEW x AS SELECT 1 FROM v,v a,v b;
|
||||
INSERT t1 SELECT @a, CONCAT('X_', @a, ' MySQL'), 1167612400 - (@a:=@a+1) FROM x, x a;
|
||||
DROP VIEW x;
|
||||
DROP VIEW v;
|
||||
INSERT t2 SELECT a, b, c FROM t1;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
FLUSH TABLES;
|
||||
|
||||
--echo # Restrict partitioned commands to partitioned tables only
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
CACHE INDEX t2 PARTITION (p0,`p1`) INDEX (`PRIMARY`) IN hot_cache;
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
CACHE INDEX t2 PARTITION (`p1`) INDEX (`PRIMARY`,`inx_b`) IN hot_cache;
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
CACHE INDEX t2 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN hot_cache;
|
||||
--echo # Basic key cache testing
|
||||
--echo # The manual correctly says: "The syntax of CACHE INDEX enables you to
|
||||
--echo # specify that only particular indexes from a table should be assigned
|
||||
--echo # to the cache. The current implementation assigns all the table's
|
||||
--echo # indexes to the cache, so there is no reason to specify anything
|
||||
--echo # other than the table name."
|
||||
--echo # So the most of the test only tests the syntax
|
||||
CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache;
|
||||
CACHE INDEX t2 KEY (`PRIMARY`) IN warm_cache;
|
||||
CACHE INDEX t2 KEY (`PRIMARY`,`inx_b`) IN cold_cache;
|
||||
CACHE INDEX t2 INDEX (inx_b,`PRIMARY`) IN default;
|
||||
CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN cold_cache;
|
||||
--error ER_PARSE_ERROR
|
||||
CACHE INDEX t1 PARTITIONS (p0) KEY (`inx_b`) IN cold_cache;
|
||||
--echo # only one table at a time if specifying partitions
|
||||
--error ER_PARSE_ERROR
|
||||
CACHE INDEX t1,t2 PARTITION (p0) KEY (`inx_b`) IN cold_cache;
|
||||
CACHE INDEX t1 PARTITION (`p0`,p1) INDEX (`PRIMARY`) IN warm_cache;
|
||||
CACHE INDEX t1 PARTITION (`p1`) INDEX (`PRIMARY`,inx_b) IN hot_cache;
|
||||
CACHE INDEX t1 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN default;
|
||||
CACHE INDEX t1 PARTITION (ALL) IN hot_cache;
|
||||
CACHE INDEX t1 INDEX (`inx_b`) IN default;
|
||||
CACHE INDEX t1 KEY (`PRIMARY`) IN hot_cache;
|
||||
CACHE INDEX t1 KEY (`PRIMARY`,`inx_b`) IN warm_cache;
|
||||
CACHE INDEX t1 INDEX (`inx_b`,`PRIMARY`) IN cold_cache;
|
||||
CACHE INDEX t1 IN hot_cache;
|
||||
--echo # Test of non existent key cache:
|
||||
--error ER_UNKNOWN_KEY_CACHE
|
||||
CACHE INDEX t1 IN non_existent_key_cache;
|
||||
--echo # Basic testing of LOAD INDEX
|
||||
LOAD INDEX INTO CACHE t2;
|
||||
--echo # PRIMARY and secondary keys have different block sizes
|
||||
LOAD INDEX INTO CACHE t2 ignore leaves;
|
||||
--echo # Must have INDEX or KEY before the index list
|
||||
--error ER_PARSE_ERROR
|
||||
LOAD INDEX INTO CACHE t2 (`PRIMARY`);
|
||||
|
||||
--echo # Test of IGNORE LEAVES
|
||||
LOAD INDEX INTO CACHE t2 INDEX (`PRIMARY`);
|
||||
LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`) IGNORE LEAVES;
|
||||
CACHE INDEX t2 IN warm_cache;
|
||||
CACHE INDEX t1 IN cold_cache;
|
||||
LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`) IGNORE LEAVES;
|
||||
CACHE INDEX t2 INDEX (`inx_b`, `inx_c`) IN hot_cache;
|
||||
LOAD INDEX INTO CACHE t2 KEY (`inx_b`, `inx_c`) IGNORE LEAVES;
|
||||
CACHE INDEX t2 IN warm_cache;
|
||||
CACHE INDEX t2 INDEX (`PRIMARY`, `inx_c`) IN hot_cache;
|
||||
LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_c`) IGNORE LEAVES;
|
||||
CACHE INDEX t2 INDEX (`inx_b`,`PRIMARY`) IN default;
|
||||
LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`);
|
||||
CACHE INDEX t2 IN default;
|
||||
LOAD INDEX INTO CACHE t2 IGNORE LEAVES;
|
||||
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
LOAD INDEX INTO CACHE t2 PARTITION (p1) INDEX (`PRIMARY`);
|
||||
LOAD INDEX INTO CACHE t1, t2;
|
||||
--echo # only one table at a time if specifying partitions
|
||||
--error ER_PARSE_ERROR
|
||||
LOAD INDEX INTO CACHE t1 PARTITION (p0), t2;
|
||||
LOAD INDEX INTO CACHE t1 IGNORE LEAVES;
|
||||
LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`);
|
||||
LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`,`inx_b`) IGNORE LEAVES;
|
||||
LOAD INDEX INTO CACHE t1 INDEX (`inx_b`) IGNORE LEAVES;
|
||||
LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`) IGNORE LEAVES;
|
||||
LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`,`inx_b`);
|
||||
LOAD INDEX INTO CACHE t1 PARTITION (p1) INDEX (`PRIMARY`);
|
||||
LOAD INDEX INTO CACHE t1 PARTITION (`p1`,p0) KEY (`PRIMARY`) IGNORE LEAVES;
|
||||
LOAD INDEX INTO CACHE t1 PARTITION (ALL);
|
||||
--error ER_PARSE_ERROR
|
||||
LOAD INDEX INTO CACHE t1 PARTITIONS ALL;
|
||||
LOAD INDEX INTO CACHE t1 PARTITION (p1,`p0`) IGNORE LEAVES;
|
||||
DROP INDEX `inx_b` on t1;
|
||||
DROP INDEX `inx_b` on t2;
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
|
||||
CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache;
|
||||
CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
|
||||
CACHE INDEX t1 INDEX (`inx_b`) IN hot_cache;
|
||||
DROP TABLE t1,t2;
|
||||
SET GLOBAL hot_cache.key_buffer_size = 0;
|
||||
SET GLOBAL warm_cache.key_buffer_size = 0;
|
||||
SET @@global.cold_cache.key_buffer_size = 0;
|
||||
SELECT @@global.default.key_buffer_size a, @@global.default.key_cache_block_size b, @@global.default.key_cache_age_threshold c, @@global.default.key_cache_division_limit d;
|
||||
SELECT @@global.hot_cache.key_buffer_size a, @@global.hot_cache.key_cache_block_size b, @@global.hot_cache.key_cache_age_threshold c, @@global.hot_cache.key_cache_division_limit d;
|
||||
SELECT @@global.warm_cache.key_buffer_size a, @@global.warm_cache.key_cache_block_size b, @@global.warm_cache.key_cache_age_threshold c, @@global.warm_cache.key_cache_division_limit d;
|
||||
SELECT @@global.cold_cache.key_buffer_size a, @@global.cold_cache.key_cache_block_size b, @@global.cold_cache.key_cache_age_threshold c, @@global.cold_cache.key_cache_division_limit d;
|
||||
--disable_warnings
|
||||
SET @@global.default.key_buffer_size = @org_key_cache_buffer_size;
|
||||
--enable_warnings
|
@ -9,6 +9,16 @@
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
#BUG#49591, Add proper version number to SHOW CREATE TABLE
|
||||
#
|
||||
create table t1 (a int)
|
||||
partition by range (a)
|
||||
subpartition by hash(to_seconds(a))
|
||||
(partition p0 values less than (1));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--error ER_NULL_IN_VALUES_LESS_THAN
|
||||
create table t1 (a int)
|
||||
partition by range (a)
|
||||
@ -30,6 +40,7 @@ explain partitions select * from t1 where a < '2007-03-08 00:00:01';
|
||||
explain partitions select * from t1 where a <= '2007-03-08 00:00:00';
|
||||
explain partitions select * from t1 where a <= '2007-03-07 23:59:59';
|
||||
explain partitions select * from t1 where a < '2007-03-07 23:59:59';
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
#
|
||||
# New test cases for new function to_seconds
|
||||
@ -44,6 +55,7 @@ explain partitions select * from t1 where a <= '2003-12-31';
|
||||
select * from t1 where a <= '2003-12-31';
|
||||
explain partitions select * from t1 where a <= '2005-01-01';
|
||||
select * from t1 where a <= '2005-01-01';
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a datetime)
|
||||
@ -56,6 +68,7 @@ explain partitions select * from t1 where a <= '2004-01-01 11:59.59';
|
||||
select * from t1 where a <= '2004-01-01 11:59:59';
|
||||
explain partitions select * from t1 where a <= '2005-01-01';
|
||||
select * from t1 where a <= '2005-01-01';
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
|
@ -9,10 +9,6 @@ show profile all;
|
||||
show session variables like 'profil%';
|
||||
select @@profiling;
|
||||
|
||||
# setting global variable is an error
|
||||
--error ER_LOCAL_VARIABLE
|
||||
set global profiling = ON;
|
||||
|
||||
# But size is okay
|
||||
set @start_value= @@global.profiling_history_size;
|
||||
set global profiling_history_size=100;
|
||||
|
@ -94,10 +94,6 @@ select sql_cache * from t1 union select * from t1;
|
||||
set query_cache_type=2;
|
||||
select sql_cache * from t1 union select * from t1;
|
||||
|
||||
# all sql_cache statements, except for the first select, are ignored.
|
||||
select * from t1 union select sql_cache * from t1;
|
||||
select * from t1 where a IN (select sql_cache a from t1);
|
||||
select * from t1 where a IN (select a from t1 union select sql_cache a from t1);
|
||||
show status like "Qcache_hits";
|
||||
show status like "Qcache_queries_in_cache";
|
||||
set query_cache_type=on;
|
||||
@ -110,15 +106,6 @@ show status like "Qcache_queries_in_cache";
|
||||
# SELECT SQL_NO_CACHE
|
||||
#
|
||||
select sql_no_cache * from t1;
|
||||
# sql_no_cache can occur in any nested select to turn on cacheing for the whole
|
||||
# expression and it will always override a sql_cache statement.
|
||||
select * from t1 union select sql_no_cache * from t1;
|
||||
select * from t1 where a IN (select sql_no_cache a from t1);
|
||||
select * from t1 where a IN (select a from t1 union select sql_no_cache a from t1);
|
||||
select sql_cache sql_no_cache * from t1;
|
||||
select sql_cache * from t1 union select sql_no_cache * from t1;
|
||||
select sql_cache * from t1 where a IN (select sql_no_cache a from t1);
|
||||
select sql_cache * from t1 where a IN (select a from t1 union select sql_no_cache a from t1);
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t1;
|
||||
#
|
||||
@ -953,9 +940,9 @@ set global query_cache_size=0;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
set GLOBAL query_cache_type=1;
|
||||
set GLOBAL query_cache_limit=10000;
|
||||
set GLOBAL query_cache_limit=10240;
|
||||
set GLOBAL query_cache_min_res_unit=0;
|
||||
set GLOBAL query_cache_size= 100000;
|
||||
set GLOBAL query_cache_size= 102400;
|
||||
|
||||
# default_week_format
|
||||
reset query cache;
|
||||
@ -1023,7 +1010,7 @@ set GLOBAL query_cache_size= default;
|
||||
# Bug#28897 UUID() returns non-unique values when query cache is enabled
|
||||
#
|
||||
|
||||
set GLOBAL query_cache_size=1000000;
|
||||
set GLOBAL query_cache_size=1024000;
|
||||
|
||||
create table t1 (a char);
|
||||
insert into t1 values ('c');
|
||||
@ -1044,22 +1031,25 @@ set GLOBAL query_cache_size= default;
|
||||
# Bug #29053 SQL_CACHE in UNION causes non-deterministic functions to be cached
|
||||
#
|
||||
|
||||
set GLOBAL query_cache_size=1000000;
|
||||
|
||||
create table t1 (a char);
|
||||
insert into t1 values ('c');
|
||||
|
||||
let $q1= `select RAND() from t1 union select sql_cache 1 from t1;`;
|
||||
let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
|
||||
|
||||
# This syntax is no longer allowed, therefore the test case has been commented
|
||||
# out.
|
||||
# See test for Bug#35020 below.
|
||||
#set GLOBAL query_cache_size=1000000;
|
||||
#
|
||||
#create table t1 (a char);
|
||||
#insert into t1 values ('c');
|
||||
#
|
||||
#let $q1= `select RAND() from t1 union select sql_cache 1 from t1;`;
|
||||
#let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
|
||||
#
|
||||
# disabling the logging of the query because the times are different each run.
|
||||
--disable_query_log
|
||||
eval select a from t1 where "$q1" = "$q2";
|
||||
--enable_query_log
|
||||
|
||||
drop table t1;
|
||||
|
||||
set GLOBAL query_cache_size= default;
|
||||
#--disable_query_log
|
||||
#eval select a from t1 where "$q1" = "$q2";
|
||||
#--enable_query_log
|
||||
#
|
||||
#drop table t1;
|
||||
#
|
||||
#set GLOBAL query_cache_size= default;
|
||||
|
||||
#
|
||||
# Bug#29856: Insufficient buffer space led to a server crash.
|
||||
@ -1189,7 +1179,7 @@ SET GLOBAL query_cache_size= default;
|
||||
--echo #
|
||||
--echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1
|
||||
--echo #
|
||||
set global query_cache_size=100000;
|
||||
set global query_cache_size=102400;
|
||||
set global query_cache_size=0;
|
||||
set global query_cache_type=0;
|
||||
show status like 'Qcache_free_blocks';
|
||||
@ -1307,5 +1297,69 @@ SELECT 1 FROM t1 GROUP BY
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL query_cache_size= default;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
#
|
||||
# Bug#35020: illegal sql_cache select syntax
|
||||
#
|
||||
CREATE TABLE t1( a INT );
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
SET @v = ( SELECT SQL_CACHE 1 );
|
||||
--error ER_PARSE_ERROR
|
||||
SET @v = ( SELECT SQL_NO_CACHE 1 );
|
||||
|
||||
#
|
||||
# Keywords 'SQL_CACHE' and 'SQL_NO_CACHE' are allowed as column names.
|
||||
# Hence the error messages are not intuitive.
|
||||
#
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT a FROM t1 WHERE a IN ( SELECT SQL_CACHE a FROM t1 );
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT a FROM t1 WHERE a IN ( SELECT SQL_NO_CACHE a FROM t1 );
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT ( SELECT SQL_CACHE a FROM t1 );
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT ( SELECT SQL_NO_CACHE a FROM t1 );
|
||||
|
||||
SELECT SQL_CACHE * FROM t1;
|
||||
SELECT SQL_NO_CACHE * FROM t1;
|
||||
|
||||
# SQL_CACHE is only allowed once in first top-level select.
|
||||
--error ER_CANT_USE_OPTION_HERE
|
||||
SELECT * FROM t1 UNION SELECT SQL_CACHE * FROM t1;
|
||||
--error ER_CANT_USE_OPTION_HERE
|
||||
SELECT * FROM t1 UNION SELECT SQL_NO_CACHE * FROM t1;
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT * FROM t1 WHERE a IN (SELECT SQL_CACHE a FROM t1);
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 UNION SELECT SQL_CACHE a FROM t1);
|
||||
|
||||
--error ER_CANT_USE_OPTION_HERE
|
||||
SELECT * FROM t1 UNION SELECT SQL_NO_CACHE * FROM t1;
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT * FROM t1 WHERE a IN (SELECT SQL_NO_CACHE a FROM t1);
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT * FROM t1 WHERE a IN
|
||||
(SELECT a FROM t1 UNION SELECT SQL_NO_CACHE a FROM t1);
|
||||
--error ER_WRONG_USAGE
|
||||
SELECT SQL_CACHE SQL_NO_CACHE * FROM t1;
|
||||
--error ER_WRONG_USAGE
|
||||
SELECT SQL_NO_CACHE SQL_CACHE * FROM t1;
|
||||
--error ER_CANT_USE_OPTION_HERE
|
||||
SELECT SQL_CACHE * FROM t1 UNION SELECT SQL_CACHE * FROM t1;
|
||||
--error ER_CANT_USE_OPTION_HERE
|
||||
SELECT SQL_CACHE * FROM t1 UNION SELECT SQL_NO_CACHE * FROM t1;
|
||||
--error ER_CANT_USE_OPTION_HERE
|
||||
SELECT SQL_NO_CACHE * FROM t1 UNION SELECT SQL_CACHE * FROM t1;
|
||||
--error ER_CANT_USE_OPTION_HERE
|
||||
SELECT SQL_NO_CACHE * FROM t1 UNION SELECT SQL_NO_CACHE * FROM t1;
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT SQL_CACHE * FROM t1 WHERE a IN
|
||||
(SELECT SQL_NO_CACHE a FROM t1);
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT SQL_CACHE * FROM t1 WHERE a IN
|
||||
(SELECT a FROM t1 UNION SELECT SQL_NO_CACHE a FROM t1);
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -6,7 +6,7 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9;
|
||||
SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9;
|
||||
create table t1 (a int auto_increment primary key, b char(20));
|
||||
insert into t1 values(1,"test");
|
||||
SELECT SQL_BUFFER_RESULT * from t1;
|
||||
@ -85,6 +85,6 @@ set local max_join_size=1;
|
||||
select * from (select 1 union select 2 union select 3) x;
|
||||
drop table t1;
|
||||
|
||||
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;
|
||||
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@ -550,18 +550,14 @@ CREATE VIEW v1 AS SELECT SQL_NO_CACHE NOW();
|
||||
SHOW CREATE VIEW v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
# Check that SQL_NO_CACHE always wins.
|
||||
--error ER_WRONG_USAGE
|
||||
CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE NOW();
|
||||
SHOW CREATE VIEW v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
--error ER_WRONG_USAGE
|
||||
CREATE VIEW v1 AS SELECT SQL_NO_CACHE SQL_CACHE NOW();
|
||||
SHOW CREATE VIEW v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
--error ER_WRONG_USAGE
|
||||
CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE SQL_CACHE NOW();
|
||||
SHOW CREATE VIEW v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
# Check CREATE VIEW in a prepared statement in a procedure.
|
||||
delimiter |;
|
||||
@ -907,7 +903,7 @@ CREATE TABLE t1(
|
||||
--echo
|
||||
--echo ---> Dumping mysqltest1 to outfile1
|
||||
|
||||
--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $outfile1
|
||||
--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1
|
||||
|
||||
# - Clean mysqltest1;
|
||||
|
||||
|
@ -3748,7 +3748,7 @@ begin
|
||||
end|
|
||||
|
||||
set @qcs1 = @@query_cache_size|
|
||||
set global query_cache_size = 100000|
|
||||
set global query_cache_size = 102400|
|
||||
set @x = 1|
|
||||
insert into t1 values ("qc", 42)|
|
||||
select bug9902() from t1|
|
||||
@ -8204,14 +8204,13 @@ DROP FUNCTION f1;
|
||||
drop procedure if exists p;
|
||||
--enable_warnings
|
||||
set @old_mode= @@sql_mode;
|
||||
set @@sql_mode= pow(2,32)-1;
|
||||
set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
|
||||
select @@sql_mode into @full_mode;
|
||||
create procedure p() begin end;
|
||||
call p();
|
||||
select @@sql_mode;
|
||||
set @@sql_mode= @old_mode;
|
||||
# Rename SQL modes that differ in name between the server and the table definition.
|
||||
select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
|
||||
select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode;
|
||||
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
|
||||
select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
|
||||
drop procedure p;
|
||||
|
@ -409,6 +409,18 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #24541: "Data truncated..." on decimal type columns without any good reason
|
||||
#
|
||||
|
||||
create table t1 (c1 decimal(10,6));
|
||||
insert into t1 (c1) values (9.99e-4);
|
||||
insert into t1 (c1) values (9.98e-4);
|
||||
insert into t1 (c1) values (0.000999);
|
||||
insert into t1 (c1) values (cast(9.99e-4 as decimal(10,6)));
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#31019: MOD() function and operator crashes MySQL when
|
||||
# divisor is very long and < 1
|
||||
|
@ -7,7 +7,7 @@ drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
|
||||
SELECT 10,10.0,10.,.1e+2,100.0e-1;
|
||||
SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
|
||||
SELECT 6e-16, -6e-16, --6e-16, -6e-16+1.000000;
|
||||
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
||||
SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01;
|
||||
SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0;
|
||||
@ -252,6 +252,37 @@ insert into t1 values (2e30), (-2e30);
|
||||
select f1 + 0e0 from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #12860 "Difference in zero padding of exponent between Unix and Windows"
|
||||
#
|
||||
|
||||
create table t1 (c char(6));
|
||||
insert into t1 values (2e6),(2e-5);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #21497 "DOUBLE truncated to unusable value"
|
||||
#
|
||||
|
||||
CREATE TABLE d1 (d DOUBLE);
|
||||
INSERT INTO d1 VALUES (1.7976931348623157E+308);
|
||||
SELECT * FROM d1;
|
||||
--error ER_ILLEGAL_VALUE_FOR_TYPE
|
||||
INSERT INTO d1 VALUES (1.79769313486232e+308);
|
||||
SELECT * FROM d1;
|
||||
DROP TABLE d1;
|
||||
|
||||
#
|
||||
# Bug #26788 "mysqld (debug) aborts when inserting specific numbers into char
|
||||
# fields"
|
||||
#
|
||||
|
||||
create table t1 (a char(20));
|
||||
insert into t1 values (1.225e-05);
|
||||
select a+0 from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #27483: Casting 'scientific notation type' to 'unsigned bigint' fails on
|
||||
# windows.
|
||||
|
@ -1054,10 +1054,8 @@ while ($max_power)
|
||||
}
|
||||
SELECT my_float, my_double, my_varchar FROM t1;
|
||||
|
||||
# Expected result 0.000000000011754943372854760000
|
||||
# On windows we get 0.000000000011754943372854770000
|
||||
# use replace_result to correct it
|
||||
--replace_result 0.000000000011754943372854770000 0.000000000011754943372854760000
|
||||
# The following statement produces results with garbage past
|
||||
# the significant digits. Improving it is a part of the WL#3977.
|
||||
SELECT CAST(my_float AS DECIMAL(65,30)), my_float FROM t1;
|
||||
SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1;
|
||||
SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1;
|
||||
|
@ -132,7 +132,7 @@ drop user mysqltest_1@localhost;
|
||||
select @@session.max_user_connections, @@global.max_user_connections;
|
||||
# Local max_user_connections variable can't be set directly
|
||||
# since this limit is per-account
|
||||
--error ER_GLOBAL_VARIABLE
|
||||
--error ER_VARIABLE_IS_READONLY
|
||||
set session max_user_connections= 2;
|
||||
# But it is ok to set global max_user_connections
|
||||
set global max_user_connections= 2;
|
||||
|
@ -122,8 +122,6 @@ select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
||||
#
|
||||
--error 1064
|
||||
set session @honk=99;
|
||||
--error 1382
|
||||
set one_shot @honk=99;
|
||||
|
||||
#
|
||||
# Bug #10724 @@local not preserved in column name of select
|
||||
|
@ -33,7 +33,7 @@ set @my_query_cache_type =@@global.query_cache_type;
|
||||
set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
|
||||
set @my_server_id =@@global.server_id;
|
||||
set @my_slow_launch_time =@@global.slow_launch_time;
|
||||
set @my_storage_engine =@@global.storage_engine;
|
||||
set @my_storage_engine =@@global.default_storage_engine;
|
||||
set @my_thread_cache_size =@@global.thread_cache_size;
|
||||
set @my_max_allowed_packet =@@global.max_allowed_packet;
|
||||
set @my_join_buffer_size =@@global.join_buffer_size;
|
||||
@ -132,12 +132,12 @@ set global timed_mutexes=0;
|
||||
show variables like 'timed_mutexes';
|
||||
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
|
||||
|
||||
set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE";
|
||||
show local variables like 'storage_engine';
|
||||
select * from information_schema.session_variables where variable_name like 'storage_engine';
|
||||
show global variables like 'storage_engine';
|
||||
select * from information_schema.global_variables where variable_name like 'storage_engine';
|
||||
set GLOBAL query_cache_size=100000;
|
||||
set default_storage_engine=MYISAM, default_storage_engine="HEAP", global default_storage_engine="MERGE";
|
||||
show local variables like 'default_storage_engine';
|
||||
select * from information_schema.session_variables where variable_name like 'default_storage_engine';
|
||||
show global variables like 'default_storage_engine';
|
||||
select * from information_schema.global_variables where variable_name like 'default_storage_engine';
|
||||
set GLOBAL query_cache_size=102400;
|
||||
|
||||
set GLOBAL myisam_max_sort_file_size=2000000;
|
||||
show global variables like 'myisam_max_sort_file_size';
|
||||
@ -213,7 +213,6 @@ set @@query_alloc_block_size=1024*17+2;
|
||||
set @@query_prealloc_size=1024*18-1023;
|
||||
set @@transaction_alloc_block_size=1024*20-1;
|
||||
set @@transaction_prealloc_size=1024*21-1;
|
||||
select @@query_alloc_block_size;
|
||||
--echo ==+ Check manipulated values ==+
|
||||
SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
|
||||
'query_alloc_block_size', 'query_prealloc_size',
|
||||
@ -250,14 +249,12 @@ set unknown_variable=1;
|
||||
--error ER_WRONG_TYPE_FOR_VAR
|
||||
set max_join_size="hello";
|
||||
--error ER_UNKNOWN_STORAGE_ENGINE
|
||||
set storage_engine=UNKNOWN_TABLE_TYPE;
|
||||
set default_storage_engine=UNKNOWN_TABLE_TYPE;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set storage_engine=MERGE, big_tables=2;
|
||||
show local variables like 'storage_engine';
|
||||
set default_storage_engine=MERGE, big_tables=2;
|
||||
show local variables like 'default_storage_engine';
|
||||
--error ER_GLOBAL_VARIABLE
|
||||
set SESSION query_cache_size=10000;
|
||||
--error ER_NO_DEFAULT
|
||||
set GLOBAL storage_engine=DEFAULT;
|
||||
--error ER_UNKNOWN_CHARACTER_SET
|
||||
set character_set_client=UNKNOWN_CHARACTER_SET;
|
||||
--error ER_UNKNOWN_COLLATION
|
||||
@ -266,18 +263,12 @@ set collation_connection=UNKNOWN_COLLATION;
|
||||
set character_set_client=NULL;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set collation_connection=NULL;
|
||||
--error ER_LOCAL_VARIABLE
|
||||
set global autocommit=1;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@global.timestamp;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
set @@version='';
|
||||
--error ER_GLOBAL_VARIABLE
|
||||
set @@concurrent_insert=1;
|
||||
--error ER_LOCAL_VARIABLE
|
||||
set @@global.sql_auto_is_null=1;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@global.sql_auto_is_null;
|
||||
--error ER_GLOBAL_VARIABLE
|
||||
set myisam_max_sort_file_size=100;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
@ -357,8 +348,6 @@ set sql_log_bin=1;
|
||||
set sql_log_off=1;
|
||||
set sql_log_update=1;
|
||||
set sql_low_priority_updates=1;
|
||||
set sql_max_join_size=200;
|
||||
select @@sql_max_join_size,@@max_join_size;
|
||||
set sql_quote_show_create=1;
|
||||
set sql_safe_updates=1;
|
||||
set sql_select_limit=1;
|
||||
@ -366,7 +355,7 @@ set sql_select_limit=1;
|
||||
set sql_select_limit=default;
|
||||
set sql_warnings=1;
|
||||
set global table_open_cache=100;
|
||||
set storage_engine=myisam;
|
||||
set default_storage_engine=myisam;
|
||||
set global thread_cache_size=100;
|
||||
set timestamp=1, timestamp=default;
|
||||
set tmp_table_size=100;
|
||||
@ -832,7 +821,7 @@ set global query_cache_type =@my_query_cache_type;
|
||||
set global rpl_recovery_rank =@my_rpl_recovery_rank;
|
||||
set global server_id =@my_server_id;
|
||||
set global slow_launch_time =@my_slow_launch_time;
|
||||
set global storage_engine =@my_storage_engine;
|
||||
set global default_storage_engine =@my_storage_engine;
|
||||
set global thread_cache_size =@my_thread_cache_size;
|
||||
set global max_allowed_packet =@my_max_allowed_packet;
|
||||
set global join_buffer_size =@my_join_buffer_size;
|
||||
@ -1187,7 +1176,7 @@ SET GLOBAL auto_increment_offset=0;
|
||||
#
|
||||
|
||||
--enable_metadata
|
||||
select @@storage_engine;
|
||||
select @@default_storage_engine;
|
||||
--disable_metadata
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user