mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Auto-merge from mysql-next-mr.
This commit is contained in:
@ -1 +1 @@
|
||||
--default-character-set=utf8 --skip-character-set-client-handshake
|
||||
--character-set-server=utf8 --skip-character-set-client-handshake
|
||||
|
@ -1 +1 @@
|
||||
--default-character-set=latin1 --default-collation=latin1_german2_ci
|
||||
--character-set-server=latin1 --collation-server=latin1_german2_ci
|
||||
|
@ -1 +1 @@
|
||||
--default-collation=ucs2_unicode_ci --default-character-set=ucs2,latin1
|
||||
--collation-server=ucs2_unicode_ci --character-set-server=ucs2,latin1
|
||||
|
@ -345,10 +345,6 @@ select date_add(date,INTERVAL "1" QUARTER) from t1;
|
||||
select timestampadd(MINUTE, 1, date) from t1;
|
||||
select timestampadd(WEEK, 1, date) from t1;
|
||||
select timestampadd(SQL_TSI_SECOND, 1, date) from t1;
|
||||
# mysqltest.c discards an expected 'deprecated' warning on prepare stage
|
||||
--disable_ps_protocol
|
||||
select timestampadd(SQL_TSI_FRAC_SECOND, 1, date) from t1;
|
||||
--enable_ps_protocol
|
||||
|
||||
select timestampdiff(MONTH, '2001-02-01', '2001-05-01') as a;
|
||||
select timestampdiff(YEAR, '2002-05-01', '2001-01-01') as a;
|
||||
@ -360,10 +356,6 @@ select timestampdiff(SQL_TSI_HOUR, '2001-02-01', '2001-05-01') as a;
|
||||
select timestampdiff(SQL_TSI_DAY, '2001-02-01', '2001-05-01') as a;
|
||||
select timestampdiff(SQL_TSI_MINUTE, '2001-02-01 12:59:59', '2001-05-01 12:58:59') as a;
|
||||
select timestampdiff(SQL_TSI_SECOND, '2001-02-01 12:59:59', '2001-05-01 12:58:58') as a;
|
||||
# mysqltest.c discards an expected 'deprecated' warning on prepare stage
|
||||
--disable_ps_protocol
|
||||
select timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a;
|
||||
--enable_ps_protocol
|
||||
|
||||
select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1,
|
||||
timestampdiff(SQL_TSI_DAY, '1900-02-01', '1900-03-01') as a2,
|
||||
@ -602,9 +594,6 @@ select isnull(week(now() + 0)), isnull(week(now() + 0.2)),
|
||||
|
||||
--echo End of 4.1 tests
|
||||
|
||||
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
|
||||
timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2;
|
||||
|
||||
#
|
||||
# Bug #10590: %h, %I, and %l format specifies should all return results in
|
||||
# the 0-11 range
|
||||
@ -797,27 +786,11 @@ select DATE_ADD(20071108, INTERVAL 1 DAY);
|
||||
|
||||
select LAST_DAY('2007-12-06 08:59:19.05') - INTERVAL 1 SECOND;
|
||||
|
||||
#
|
||||
# Bug#33834: FRAC_SECOND: Applicability not clear in documentation
|
||||
#
|
||||
# Show that he use of FRAC_SECOND, for anything other than
|
||||
# TIMESTAMPADD / TIMESTAMPDIFF, is a server error.
|
||||
|
||||
# mysqltest.c discards an expected 'deprecated' warning on prepare stage
|
||||
--disable_ps_protocol
|
||||
SELECT TIMESTAMPADD(FRAC_SECOND, 1, '2008-02-18');
|
||||
SELECT TIMESTAMPDIFF(FRAC_SECOND, '2008-02-17', '2008-02-18');
|
||||
--enable_ps_protocol
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
SELECT DATE_ADD('2008-02-18', INTERVAL 1 FRAC_SECOND);
|
||||
--error ER_PARSE_ERROR
|
||||
SELECT DATE_SUB('2008-02-18', INTERVAL 1 FRAC_SECOND);
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
SELECT '2008-02-18' + INTERVAL 1 FRAC_SECOND;
|
||||
--error ER_PARSE_ERROR
|
||||
SELECT '2008-02-18' - INTERVAL 1 FRAC_SECOND;
|
||||
# Test case removed since FRAC_SECOND was deprecated and
|
||||
# removed as part of WL#5154
|
||||
#
|
||||
|
||||
#
|
||||
# Bug #36466:
|
||||
|
@ -555,3 +555,42 @@ create table t2 (fk int, key x (fk),
|
||||
constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
|
||||
show create table t2;
|
||||
drop table t2, t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#44613 SELECT statement inside FUNCTION takes a shared lock
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(x INT PRIMARY KEY, y INT) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (1, 0), (2, 0);
|
||||
|
||||
CREATE FUNCTION f1(z INT) RETURNS INT READS SQL DATA
|
||||
RETURN (SELECT x FROM t1 WHERE x = z);
|
||||
|
||||
--echo # Connection default
|
||||
START TRANSACTION;
|
||||
SELECT f1(1);
|
||||
|
||||
--echo # Connection con2
|
||||
--disable_query_log
|
||||
connect (con2, localhost, root);
|
||||
--enable_query_log
|
||||
START TRANSACTION;
|
||||
SELECT f1(1);
|
||||
# This next statement used to block.
|
||||
UPDATE t1 SET y = 1 WHERE x = 1;
|
||||
|
||||
COMMIT;
|
||||
|
||||
disconnect con2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
COMMIT;
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
|
@ -65,13 +65,13 @@ select "--- --database --" as "";
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLD_DATADIR/master-bin.000001 2> /dev/null
|
||||
|
||||
# this test for position option
|
||||
# this test for start-position option
|
||||
--disable_query_log
|
||||
select "--- --position --" as "";
|
||||
select "--- --start-position --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=1074 $MYSQLD_DATADIR/master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --start-position=1074 $MYSQLD_DATADIR/master-bin.000002
|
||||
|
||||
# These are tests for remote binlog.
|
||||
# They should return the same as previous test.
|
||||
@ -103,11 +103,11 @@ select "--- --database --" as "";
|
||||
|
||||
# Strangely but this works
|
||||
--disable_query_log
|
||||
select "--- --position --" as "";
|
||||
select "--- --start-position --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=1074 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --start-position=1074 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
|
||||
|
||||
|
||||
# Bug#7853 mysqlbinlog does not accept input from stdin
|
||||
@ -120,7 +120,7 @@ select "--- reading stdin --" as "";
|
||||
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
|
||||
--exec $MYSQL_BINLOG --short-form --position=79 - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=79 - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
|
@ -1,3 +1,4 @@
|
||||
--source include/not_windows.inc
|
||||
#
|
||||
# Check if the variable MY_PERROR is set
|
||||
#
|
||||
@ -17,3 +18,17 @@ enable_query_log;
|
||||
# As there is no error code defined for 10000, expect error
|
||||
--error 1
|
||||
--exec $MY_PERROR 10000 2>&1
|
||||
|
||||
#
|
||||
# Bug#10143 (Perror not showing error description)
|
||||
#
|
||||
|
||||
# test reported case
|
||||
--exec $MY_PERROR 1062 2>&1
|
||||
|
||||
# test errors that contain characters to escape in the text.
|
||||
--exec $MY_PERROR 1076 2>&1
|
||||
--exec $MY_PERROR 1459 2>&1
|
||||
--exec $MY_PERROR 1461 2>&1
|
||||
|
||||
|
||||
|
@ -1 +1 @@
|
||||
--log-output=table,file --log-slow-queries --log-long-format --log-queries-not-using-indexes
|
||||
--log-output=table,file --log-slow-queries --log-queries-not-using-indexes
|
||||
|
@ -1 +1 @@
|
||||
--log-output=table,file --log-slow-queries --log-long-format --log-queries-not-using-indexes --myisam-recover=""
|
||||
--log-output=table,file --log-slow-queries --log-queries-not-using-indexes --myisam-recover=""
|
||||
|
@ -436,6 +436,75 @@ SELECT * FROM t2 WHERE a = sequence();
|
||||
DROP FUNCTION sequence;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug#31767 (DROP FUNCTION name resolution)
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop function if exists test.metaphon;
|
||||
drop function if exists metaphon;
|
||||
--enable_warnings
|
||||
|
||||
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
|
||||
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
|
||||
|
||||
select metaphon("Hello");
|
||||
|
||||
# The UDF should not be dropped
|
||||
drop function if exists test.metaphon;
|
||||
|
||||
select metaphon("Hello");
|
||||
|
||||
drop function metaphon;
|
||||
|
||||
CREATE FUNCTION test.metaphon(a TEXT) RETURNS TEXT return "This is a SF";
|
||||
|
||||
create database db_31767;
|
||||
use db_31767;
|
||||
|
||||
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
|
||||
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
|
||||
|
||||
use test;
|
||||
|
||||
# Uses the UDF
|
||||
select metaphon("Hello");
|
||||
|
||||
# Uses the SF
|
||||
select test.metaphon("Hello");
|
||||
|
||||
# Should drop the UDF, resolving the name the same way select does.
|
||||
drop function metaphon;
|
||||
|
||||
# Should call the SF
|
||||
select metaphon("Hello");
|
||||
|
||||
# Drop the SF
|
||||
drop function metaphon;
|
||||
|
||||
# Change the current database to none.
|
||||
use db_31767;
|
||||
drop database db_31767;
|
||||
|
||||
drop function if exists no_such_func;
|
||||
|
||||
--error ER_SP_DOES_NOT_EXIST
|
||||
drop function no_such_func;
|
||||
|
||||
drop function if exists test.no_such_func;
|
||||
|
||||
--error ER_SP_DOES_NOT_EXIST
|
||||
drop function test.no_such_func;
|
||||
|
||||
--error ER_NO_DB_ERROR
|
||||
drop procedure if exists no_such_proc;
|
||||
|
||||
--error ER_NO_DB_ERROR
|
||||
drop procedure no_such_proc;
|
||||
|
||||
use test;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#46259: 5.0.83 -> 5.1.36, query doesn't work
|
||||
--echo #
|
||||
|
@ -1 +1 @@
|
||||
--log-slow-queries --log-long-format --log-queries-not-using-indexes
|
||||
--log-slow-queries --log-queries-not-using-indexes
|
||||
|
@ -346,7 +346,6 @@ set sql_big_tables=1;
|
||||
set sql_buffer_result=1;
|
||||
set sql_log_bin=1;
|
||||
set sql_log_off=1;
|
||||
set sql_log_update=1;
|
||||
set sql_low_priority_updates=1;
|
||||
set sql_quote_show_create=1;
|
||||
set sql_safe_updates=1;
|
||||
|
@ -6,6 +6,9 @@ drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
use test;
|
||||
|
||||
# Save the initial number of concurrent sessions.
|
||||
--source include/count_sessions.inc
|
||||
|
||||
#
|
||||
# some basic test of views and its functionality
|
||||
#
|
||||
@ -3975,3 +3978,79 @@ CREATE VIEW t2 AS SELECT * FROM t1;
|
||||
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#48315 Metadata lock is not taken for merged views that
|
||||
--echo # use an INFORMATION_SCHEMA table
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
connect (con2, localhost, root);
|
||||
connect (con3, localhost, root);
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
|
||||
CREATE VIEW v1 AS SELECT schema_name FROM information_schema.schemata;
|
||||
CREATE TABLE t1 (str VARCHAR(50));
|
||||
CREATE PROCEDURE p1() INSERT INTO t1 SELECT * FROM v1;
|
||||
|
||||
--echo # CALL p1() so the view is merged.
|
||||
CALL p1();
|
||||
|
||||
--echo # Connection 3
|
||||
connection con3;
|
||||
LOCK TABLE t1 READ;
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
--echo # Try to CALL p1() again, this time it should block for t1.
|
||||
--echo # Sending:
|
||||
--send CALL p1()
|
||||
|
||||
--echo # Connection 2
|
||||
connection con2;
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 from information_schema.processlist
|
||||
WHERE state = "Table lock" AND info = "INSERT INTO t1 SELECT * FROM v1";
|
||||
--source include/wait_condition.inc
|
||||
--echo # ... then try to drop the view. This should block.
|
||||
--echo # Sending:
|
||||
--send DROP VIEW v1
|
||||
|
||||
--echo # Connection 3
|
||||
connection con3;
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 from information_schema.processlist
|
||||
WHERE state = "Waiting for table" AND info = "DROP VIEW v1";
|
||||
--source include/wait_condition.inc
|
||||
--echo # Now allow CALL p1() to complete
|
||||
UNLOCK TABLES;
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
--echo # Reaping: CALL p1()
|
||||
--reap
|
||||
|
||||
--echo # Connection 2
|
||||
connection con2;
|
||||
--echo # Reaping: DROP VIEW v1
|
||||
--reap
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
disconnect con2;
|
||||
disconnect con3;
|
||||
|
||||
|
||||
# Check that all connections opened by test cases in this file are really
|
||||
# gone so execution of other tests won't be affected by their presence.
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
Reference in New Issue
Block a user