1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

due to merge.

This commit is contained in:
Horst Hunger
2009-01-23 19:21:08 +01:00
39 changed files with 368 additions and 161 deletions

View File

@ -29,6 +29,7 @@
SET @global_character_set_database = @@global.character_set_database;
SET @session_character_set_database = @@session.character_set_database;
SET @session_character_set_server = @@session.character_set_server;
SET @global_character_set_server = @@global.character_set_server;
SET @@global.character_set_database = utf8;
--echo 'connect (con1,localhost,root,,,,)'
@ -106,10 +107,30 @@ SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
DROP TABLE IF EXISTS t1;
--enable_warnings
#==============================================================================
--echo 'Bug#27208: If no current database, character_set_database !=character_set_server'
#==============================================================================
SET GLOBAL character_set_server=latin5;
connect (con2, localhost, root,,);
connection con2;
CREATE DATABASE csdb CHARACTER SET = utf8;
USE csdb;
DROP DATABASE csdb;
SELECT @@character_set_database;
connection default;
disconnect con2;
#restore
SET @@global.character_set_database = @global_character_set_database;
SET @@session.character_set_database = @session_character_set_database;
SET @@session.character_set_server = @session_character_set_server;
SET @@global.character_set_server = @global_character_set_server;
############################################################
# End of functionality Testing for character_set_database #
############################################################

View File

@ -6,10 +6,15 @@
drop table if exists t1;
--enable_warnings
--replace_result ROW <format> STATEMENT <format> MIXED <format>
SHOW GLOBAL VARIABLES LIKE "%e_format";
--replace_result ROW <format> STATEMENT <format> MIXED <format>
SHOW SESSION VARIABLES LIKE "%e_format";
SELECT variable_name, variable_value
FROM information_schema.global_variables
WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
ORDER BY variable_name;
SELECT variable_name, variable_value
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
@ -36,8 +41,10 @@ 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';
--replace_result ROW <format> STATEMENT <format> MIXED <format>
SHOW SESSION VARIABLES LIKE "%e_format";
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';
@ -121,7 +128,7 @@ SET datetime_format=default;
# Test of str_to_date
#
# PS doesn't support fraction of a seconds
# PS doesn't support fractions of a second
--disable_ps_protocol
select str_to_date(concat('15-01-2001',' 2:59:58.999'),
concat('%d-%m-%Y',' ','%H:%i:%s.%f'));

View File

@ -432,3 +432,14 @@ select f1 from t1 having max(f1)=f1;
select f1 from t1 group by f1 having max(f1)=f1;
set session sql_mode='';
drop table t1;
#
# Bug #38637: COUNT DISTINCT prevents NULL testing in HAVING clause
#
CREATE TABLE t1 ( a INT, b INT);
INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL);
SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
DROP TABLE t1;
--echo End of 5.0 tests

View File

@ -1 +1 @@
--innodb_locks_unsafe_for_binlog=true --innodb_lock_wait_timeout=2
--innodb_lock_wait_timeout=2

View File

@ -11,7 +11,7 @@ connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
set binlog_format=mixed;
set session transaction isolation level read committed;
set session transaction isolation level repeatable read;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
set autocommit=0;
@ -19,13 +19,15 @@ set autocommit=0;
select * from t1 where a=3 lock in share mode;
connection b;
set binlog_format=mixed;
set session transaction isolation level read committed;
set session transaction isolation level repeatable read;
set autocommit=0;
-- error ER_LOCK_WAIT_TIMEOUT
update t1 set a=10 where a=5;
connection a;
commit;
connection b;
# perform a semi-consisent read (and unlock non-matching rows)
set session transaction isolation level read committed;
update t1 set a=10 where a=5;
connection a;
-- error ER_LOCK_WAIT_TIMEOUT
@ -33,6 +35,7 @@ select * from t1 where a=2 for update;
# this should lock the records (1),(2)
select * from t1 where a=2 limit 1 for update;
connection b;
# semi-consistent read will skip non-matching locked rows a=1, a=2
update t1 set a=11 where a=6;
-- error ER_LOCK_WAIT_TIMEOUT
update t1 set a=12 where a=2;

View File

@ -34,6 +34,8 @@ DROP TABLE t1;
#
# Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table.
# expanded with testcase for
# BUG#41574 - REPAIR TABLE: crashes for compressed tables
#
--disable_warnings
drop table if exists t1;
@ -55,4 +57,5 @@ insert into t1 select * from t1;
flush tables;
--exec $MYISAMPACK $MYSQLTEST_VARDIR/master-data/test/t1
optimize table t1;
repair table t1;
drop table t1;

View File

@ -14,7 +14,7 @@ connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
set binlog_format=mixed;
set session transaction isolation level read committed;
set session transaction isolation level repeatable read;
create table t1(a int not null)
engine=innodb
DEFAULT CHARSET=latin1
@ -27,7 +27,7 @@ set autocommit=0;
select * from t1 where a=3 lock in share mode;
connection b;
set binlog_format=mixed;
set session transaction isolation level read committed;
set session transaction isolation level repeatable read;
set autocommit=0;
-- error ER_LOCK_WAIT_TIMEOUT
update t1 set a=10 where a=5;
@ -35,6 +35,8 @@ connection a;
#DELETE FROM t1 WHERE a=5;
commit;
connection b;
# perform a semi-consisent read (and unlock non-matching rows)
set session transaction isolation level read committed;
update t1 set a=10 where a=5;
connection a;
-- error ER_LOCK_WAIT_TIMEOUT
@ -42,6 +44,7 @@ select * from t1 where a=2 for update;
# this should lock the records (1),(2)
select * from t1 where a=2 limit 1 for update;
connection b;
# semi-consistent read will skip non-matching locked rows a=1, a=2
update t1 set a=11 where a=6;
-- error ER_LOCK_WAIT_TIMEOUT
update t1 set a=12 where a=2;

View File

@ -224,6 +224,38 @@ disconnect con2;
connection default;
set GLOBAL query_cache_size=0;
#
# Bug#40264: Aborted cached query causes query to hang indefinitely on next cache hit
#
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
FLUSH STATUS;
SET GLOBAL query_cache_size=1048576;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
SHOW STATUS LIKE 'Qcache_queries_in_cache';
LOCK TABLES t1 WRITE;
connect(con1,localhost,root,,);
--send SELECT * FROM t1
connection default;
let $show_type= open tables where `table`='t1' and in_use=2;
let $show_pattern= '%t1%2%';
--source include/wait_show_pattern.inc
dirty_close con1;
UNLOCK TABLES;
let $show_type= open tables where `table`='t1' and in_use=0;
let $show_pattern= '%t1%0%';
--source include/wait_show_pattern.inc
SHOW STATUS LIKE 'Qcache_queries_in_cache';
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
# End of 5.0 tests
SET GLOBAL log_bin_trust_function_creators = 0;
#