mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1
This commit is contained in:
commit
c6bdcd19f2
156 changed files with 2613 additions and 8509 deletions
|
@ -136,6 +136,9 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
|
|||
# generate .map files
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS")
|
||||
|
||||
# set stack size (see bug#20815)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1048576")
|
||||
|
||||
# remove support for Exception handling
|
||||
STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
|
|
|
@ -20,6 +20,7 @@ AUTOMAKE_OPTIONS = foreign
|
|||
# These are built from source in the Docs directory
|
||||
EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
|
||||
README COPYING EXCEPTIONS-CLIENT CMakeLists.txt
|
||||
|
||||
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
|
||||
@readline_topdir@ sql-common scripts \
|
||||
@thread_dirs@ pstack \
|
||||
|
@ -148,10 +149,6 @@ test-bt:
|
|||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
|
||||
|
||||
# Re-enable the "rowlock" suite when bug#28685 is fixed
|
||||
# -cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
# @PERL@ ./mysql-test-run.pl --force --comment=rowlock --suite=row_lock
|
||||
|
||||
# Re-enable the "jp" suite when bug#28563 is fixed
|
||||
# -cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
# @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c
|
||||
AHDR = vi.h emacs.h common.h
|
||||
|
||||
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||
-I$(srcdir)/../.. -I..
|
||||
# Make sure to include stuff from this directory first, to get right "config.h"
|
||||
INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include
|
||||
|
||||
noinst_LIBRARIES = libedit.a
|
||||
|
||||
|
|
|
@ -450,6 +450,29 @@ AC_DEFINE([HAVE_BOOL], [1], [bool is not defined by all C++ compilators])
|
|||
fi
|
||||
])dnl
|
||||
|
||||
AC_DEFUN([MYSQL_STACK_DIRECTION],
|
||||
[AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
|
||||
[AC_TRY_RUN([#include <stdlib.h>
|
||||
int find_stack_direction ()
|
||||
{
|
||||
static char *addr = 0;
|
||||
auto char dummy;
|
||||
if (addr == 0)
|
||||
{
|
||||
addr = &dummy;
|
||||
return find_stack_direction ();
|
||||
}
|
||||
else
|
||||
return (&dummy > addr) ? 1 : -1;
|
||||
}
|
||||
int main ()
|
||||
{
|
||||
exit (find_stack_direction() < 0);
|
||||
}], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
|
||||
ac_cv_c_stack_direction=)])
|
||||
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
|
||||
])dnl
|
||||
|
||||
AC_DEFUN([MYSQL_CHECK_LONGLONG_TO_FLOAT],
|
||||
[
|
||||
AC_MSG_CHECKING(if conversion of longlong to float works)
|
||||
|
@ -615,7 +638,6 @@ AC_SUBST(CXX_VERSION)
|
|||
])
|
||||
|
||||
AC_DEFUN([MYSQL_PROG_AR], [
|
||||
AC_REQUIRE([MYSQL_CHECK_CXX_VERSION])
|
||||
case $CXX_VERSION in
|
||||
MIPSpro*)
|
||||
AR=$CXX
|
||||
|
|
|
@ -11,7 +11,7 @@ AC_CANONICAL_SYSTEM
|
|||
# When changing major version number please also check switch statement
|
||||
# in mysqlbinlog::check_master_version().
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.21-beta)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
DOT_FRM_VERSION=6
|
||||
|
@ -1792,6 +1792,8 @@ MYSQL_TYPE_ACCEPT
|
|||
#---END:
|
||||
# Figure out what type of struct rlimit to use with setrlimit
|
||||
MYSQL_TYPE_STRUCT_RLIMIT
|
||||
# Find where the stack goes
|
||||
MYSQL_STACK_DIRECTION
|
||||
# We want to skip alloca on irix unconditionally. It may work on some version..
|
||||
MYSQL_FUNC_ALLOCA
|
||||
# Do struct timespec have members tv_sec or ts_sec
|
||||
|
|
|
@ -53,8 +53,11 @@ link_sources:
|
|||
@yassl_h_ln_cmd@
|
||||
echo timestamp > link_sources
|
||||
|
||||
my_config.h: ../config.h
|
||||
$(CP) ../config.h my_config.h
|
||||
# We want both "my_config.h" and "config.h" that are identical, as
|
||||
# MySQL sources assumes the name "my_config.h", and 3rd party sources
|
||||
# assumes the name "config.h".
|
||||
my_config.h: config.h
|
||||
$(CP) config.h my_config.h
|
||||
|
||||
# These files should not be included in distributions since they are
|
||||
# generated by configure from the .h.in files
|
||||
|
|
|
@ -112,6 +112,9 @@ extern "C" {
|
|||
/* signal by closing the sockets */
|
||||
#define SIGNAL_WITH_VIO_CLOSE 1
|
||||
|
||||
/* On NetWare, stack grows towards lower address */
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */
|
||||
#define NW_THD_STACKSIZE 65536
|
||||
|
||||
|
|
|
@ -250,6 +250,8 @@ inline double ulonglong2double(ulonglong value)
|
|||
#endif
|
||||
|
||||
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Optimized store functions for Intel x86 */
|
||||
|
||||
#ifndef _WIN64
|
||||
|
|
|
@ -804,6 +804,10 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||
#define ulong_to_double(X) ((double) (ulong) (X))
|
||||
#define SET_STACK_SIZE(X) /* Not needed on real machines */
|
||||
|
||||
#ifndef STACK_DIRECTION
|
||||
#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRTOK_R)
|
||||
#define strtok_r(A,B,C) strtok((A),(B))
|
||||
#endif
|
||||
|
|
|
@ -28,9 +28,6 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) suite
|
|||
GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run
|
||||
PRESCRIPTS = mysql-test-run.pl mysql-stress-test.pl
|
||||
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
|
||||
test_DATA = std_data/client-key.pem std_data/client-cert.pem \
|
||||
std_data/cacert.pem std_data/server-cert.pem \
|
||||
std_data/server-key.pem
|
||||
CLEANFILES = $(GENSCRIPTS)
|
||||
|
||||
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
|
||||
|
|
|
@ -437,19 +437,23 @@ eval SELECT *
|
|||
# check also with a 'simple' user
|
||||
CREATE USER user_3212@localhost;
|
||||
GRANT ALL ON db_datadict.* TO user_3212@localhost;
|
||||
# OBN: The following line was added following the fix to bug 28181
|
||||
# where queries to information_schema will fail if exporting to
|
||||
# a file without having the FILE attribute
|
||||
GRANT FILE ON *.* TO user_3212@localhost;
|
||||
|
||||
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (u3212,localhost,user_3212,,db_datadict);
|
||||
--source suite/funcs_1/include/show_connection.inc
|
||||
|
||||
# no db given --> db_datadict.schema does not exist
|
||||
--error 1045
|
||||
--error 1146
|
||||
eval SELECT *
|
||||
INTO OUTFILE '../tmp/out.$ENGINE_TYPE.user.file'
|
||||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
LINES TERMINATED BY '\n'
|
||||
FROM schemata LIMIT 0, 5;
|
||||
# FIXME 3.2.1.2: why do we get different error numbers with and without OUTFILE ?
|
||||
--error 1146
|
||||
eval SELECT *
|
||||
FROM schemata LIMIT 0, 5;
|
||||
|
@ -460,8 +464,6 @@ eval SELECT *
|
|||
LINES TERMINATED BY '\n'
|
||||
FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_%';
|
||||
# The above will fail with access error as long as
|
||||
# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
|
||||
|
||||
eval SELECT *
|
||||
FROM information_schema.schemata
|
||||
|
@ -469,14 +471,11 @@ eval SELECT *
|
|||
|
||||
USE information_schema;
|
||||
|
||||
# no db given --> db_datadict.schema does not exist
|
||||
eval SELECT *
|
||||
INTO OUTFILE '../tmp/out.$ENGINE_TYPE.user_2.file'
|
||||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
LINES TERMINATED BY '\n'
|
||||
FROM schemata LIMIT 0, 5;
|
||||
# The above will fail with access error as long as
|
||||
# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
|
||||
|
||||
eval SELECT *
|
||||
FROM schemata LIMIT 0, 5;
|
||||
|
@ -487,8 +486,6 @@ eval SELECT *
|
|||
LINES TERMINATED BY '\n'
|
||||
FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_%';
|
||||
# The above will fail with access error as long as
|
||||
# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
|
||||
|
||||
eval SELECT *
|
||||
FROM information_schema.schemata
|
||||
|
|
0
mysql-test/suite/funcs_1/datadict/datadict_tables_error_1044.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/datadict/datadict_tables_error_1044.inc
Normal file → Executable file
|
@ -6055,6 +6055,7 @@ INTO OUTFILE '../tmp/out.innodb.db.file'
|
|||
WHERE schema_name LIKE 'db_%';
|
||||
CREATE USER user_3212@localhost;
|
||||
GRANT ALL ON db_datadict.* TO user_3212@localhost;
|
||||
GRANT FILE ON *.* TO user_3212@localhost;
|
||||
connect(localhost,user_3212,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
|
||||
|
||||
user_3212@localhost db_datadict
|
||||
|
@ -6063,7 +6064,7 @@ INTO OUTFILE '../tmp/out.innodb.user.file'
|
|||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
LINES TERMINATED BY '\n'
|
||||
FROM schemata LIMIT 0, 5;
|
||||
ERROR 28000: Access denied for user 'user_3212'@'localhost' (using password: NO)
|
||||
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
|
||||
SELECT *
|
||||
FROM schemata LIMIT 0, 5;
|
||||
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
|
||||
|
|
File diff suppressed because it is too large
Load diff
0
mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_03.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_03.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
Normal file → Executable file
|
@ -242,7 +242,7 @@ create table t1 (f1 integer) engine = innodb;
|
|||
use test;
|
||||
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
|
||||
for each row set @ret_trg6_2 = 5;
|
||||
ERROR HY000: Trigger in wrong schema
|
||||
ERROR 42S02: Table 'trig_db.tb3' doesn't exist
|
||||
use trig_db;
|
||||
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
|
||||
for each row set @ret_trg6_3 = 18;
|
||||
|
|
|
@ -492,9 +492,8 @@ BEGIN
|
|||
WHILE @counter1 < new.f136
|
||||
SET @counter1 = @counter1 + 1;
|
||||
END//
|
||||
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 'WHILE @counter1 < new.f136
|
||||
SET @counter1 = @counter1 + 1;
|
||||
END' at line 3
|
||||
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 'SET @counter1 = @counter1 + 1;
|
||||
END' at line 4
|
||||
delete from tb3 where f122='Test 3.5.8.5-while';
|
||||
drop trigger trg7;
|
||||
|
||||
|
|
|
@ -10202,7 +10202,8 @@ SHOW FIELDS FROM v1;
|
|||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
CHECK TABLE v1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.v1 check error Table 'test.v1' doesn't exist
|
||||
test.v1 check Error Table 'test.v1' doesn't exist
|
||||
test.v1 check error Corrupt
|
||||
DESCRIBE v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
EXPLAIN SELECT * FROM v1;
|
||||
|
|
|
@ -6038,6 +6038,7 @@ INTO OUTFILE '../tmp/out.memory.db.file'
|
|||
WHERE schema_name LIKE 'db_%';
|
||||
CREATE USER user_3212@localhost;
|
||||
GRANT ALL ON db_datadict.* TO user_3212@localhost;
|
||||
GRANT FILE ON *.* TO user_3212@localhost;
|
||||
connect(localhost,user_3212,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
|
||||
|
||||
user_3212@localhost db_datadict
|
||||
|
@ -6046,7 +6047,7 @@ INTO OUTFILE '../tmp/out.memory.user.file'
|
|||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
LINES TERMINATED BY '\n'
|
||||
FROM schemata LIMIT 0, 5;
|
||||
ERROR 28000: Access denied for user 'user_3212'@'localhost' (using password: NO)
|
||||
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
|
||||
SELECT *
|
||||
FROM schemata LIMIT 0, 5;
|
||||
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
|
||||
|
|
File diff suppressed because it is too large
Load diff
0
mysql-test/suite/funcs_1/r/memory_storedproc_02.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_02.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_03.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_03.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_07.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_07.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_08.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_08.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_10.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/memory_storedproc_10.result
Normal file → Executable file
|
@ -238,7 +238,7 @@ create table t1 (f1 integer) engine = memory;
|
|||
use test;
|
||||
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
|
||||
for each row set @ret_trg6_2 = 5;
|
||||
ERROR HY000: Trigger in wrong schema
|
||||
ERROR 42S02: Table 'trig_db.tb3' doesn't exist
|
||||
use trig_db;
|
||||
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
|
||||
for each row set @ret_trg6_3 = 18;
|
||||
|
|
|
@ -488,9 +488,8 @@ BEGIN
|
|||
WHILE @counter1 < new.f136
|
||||
SET @counter1 = @counter1 + 1;
|
||||
END//
|
||||
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 'WHILE @counter1 < new.f136
|
||||
SET @counter1 = @counter1 + 1;
|
||||
END' at line 3
|
||||
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 'SET @counter1 = @counter1 + 1;
|
||||
END' at line 4
|
||||
delete from tb3 where f122='Test 3.5.8.5-while';
|
||||
drop trigger trg7;
|
||||
|
||||
|
|
|
@ -10207,7 +10207,8 @@ SHOW FIELDS FROM v1;
|
|||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
CHECK TABLE v1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.v1 check error Table 'test.v1' doesn't exist
|
||||
test.v1 check Error Table 'test.v1' doesn't exist
|
||||
test.v1 check error Corrupt
|
||||
DESCRIBE v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
EXPLAIN SELECT * FROM v1;
|
||||
|
|
|
@ -6108,6 +6108,7 @@ INTO OUTFILE '../tmp/out.myisam.db.file'
|
|||
WHERE schema_name LIKE 'db_%';
|
||||
CREATE USER user_3212@localhost;
|
||||
GRANT ALL ON db_datadict.* TO user_3212@localhost;
|
||||
GRANT FILE ON *.* TO user_3212@localhost;
|
||||
connect(localhost,user_3212,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
|
||||
|
||||
user_3212@localhost db_datadict
|
||||
|
@ -6116,7 +6117,7 @@ INTO OUTFILE '../tmp/out.myisam.user.file'
|
|||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
LINES TERMINATED BY '\n'
|
||||
FROM schemata LIMIT 0, 5;
|
||||
ERROR 28000: Access denied for user 'user_3212'@'localhost' (using password: NO)
|
||||
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
|
||||
SELECT *
|
||||
FROM schemata LIMIT 0, 5;
|
||||
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
|
||||
|
|
File diff suppressed because it is too large
Load diff
0
mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_03.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_03.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
Normal file → Executable file
0
mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
Normal file → Executable file
|
@ -242,7 +242,7 @@ create table t1 (f1 integer) engine = myisam;
|
|||
use test;
|
||||
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
|
||||
for each row set @ret_trg6_2 = 5;
|
||||
ERROR HY000: Trigger in wrong schema
|
||||
ERROR 42S02: Table 'trig_db.tb3' doesn't exist
|
||||
use trig_db;
|
||||
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
|
||||
for each row set @ret_trg6_3 = 18;
|
||||
|
|
|
@ -492,9 +492,8 @@ BEGIN
|
|||
WHILE @counter1 < new.f136
|
||||
SET @counter1 = @counter1 + 1;
|
||||
END//
|
||||
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 'WHILE @counter1 < new.f136
|
||||
SET @counter1 = @counter1 + 1;
|
||||
END' at line 3
|
||||
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 'SET @counter1 = @counter1 + 1;
|
||||
END' at line 4
|
||||
delete from tb3 where f122='Test 3.5.8.5-while';
|
||||
drop trigger trg7;
|
||||
|
||||
|
|
|
@ -1948,7 +1948,7 @@ f1 f2
|
|||
2 two
|
||||
4 four
|
||||
INSERT INTO v1 VALUES(2,'two');
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
INSERT INTO v1 VALUES(3,'three');
|
||||
affected rows: 1
|
||||
INSERT INTO v1 VALUES(6,'six');
|
||||
|
@ -1967,7 +1967,7 @@ f1 f2
|
|||
3 three
|
||||
4 four
|
||||
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
|
||||
affected rows: 1
|
||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
|
@ -2014,12 +2014,12 @@ DROP VIEW IF EXISTS test.v1;
|
|||
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
|
||||
ENGINE = myisam;
|
||||
INSERT INTO t1 VALUES ('A', 1);
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
A 1
|
||||
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
|
||||
WITH CASCADED CHECK OPTION ;
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
SELECT * FROM v1;
|
||||
f1 f2
|
||||
A 1
|
||||
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
|
||||
|
@ -2027,7 +2027,7 @@ affected rows: 1
|
|||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
||||
INSERT INTO v1 VALUES('B',2);
|
||||
affected rows: 1
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
SELECT * FROM v1;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
|
@ -2035,7 +2035,7 @@ UPDATE v1 SET f2 = 4;
|
|||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
INSERT INTO v1 VALUES('B',3);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||
SELECT * FROM v1 order by f1, f2;
|
||||
SELECT * FROM v1;
|
||||
f1 f2
|
||||
A 2
|
||||
B 2
|
||||
|
@ -10224,7 +10224,8 @@ SHOW FIELDS FROM v1;
|
|||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
CHECK TABLE v1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.v1 check error Table 'test.v1' doesn't exist
|
||||
test.v1 check Error Table 'test.v1' doesn't exist
|
||||
test.v1 check error Corrupt
|
||||
DESCRIBE v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
EXPLAIN SELECT * FROM v1;
|
||||
|
@ -10575,7 +10576,7 @@ f1 f2 f3 f4
|
|||
DELETE FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
|
@ -10644,7 +10645,7 @@ DROP VIEW v1;
|
|||
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
INSERT INTO v1 SET f2 = 'ABC';
|
||||
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
||||
ERROR 23000: Duplicate entry '0' for key 1
|
||||
SELECT * from t1;
|
||||
f1 f2 f3 f4
|
||||
0 ABC NULL NULL
|
||||
|
@ -10979,11 +10980,11 @@ f1 bigint(20) YES NULL
|
|||
f2 date YES NULL
|
||||
f4 char(5) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11003,12 +11004,12 @@ f4x char(5) YES NULL
|
|||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f2 f4x report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
|
||||
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
|
||||
|
@ -11026,14 +11027,14 @@ f1 bigint(20) YES NULL
|
|||
f2 date YES NULL
|
||||
f4 char(10) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
0 NULL ABC t1 1
|
||||
2 NULL <-- 10 --> t1 2
|
||||
2 NULL <-- 10 --> v1 2
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11062,7 +11063,7 @@ f1 bigint(20) YES NULL
|
|||
f2 date YES NULL
|
||||
f4 char(8) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11071,7 +11072,7 @@ f1 f2 f4 report
|
|||
2 NULL <-- 10 - v1 2
|
||||
3 NULL <-- 10 - t1 3
|
||||
3 NULL <-- 10 - v1 3
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11095,7 +11096,7 @@ f1 bigint(20) YES NULL
|
|||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11106,7 +11107,7 @@ f1 f2 f4 report
|
|||
3 NULL <-- 10 - v1 3
|
||||
4 NULL <------ 20 --------> t1 4
|
||||
4 NULL <------ 20 --------> v1 4
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11134,7 +11135,7 @@ f1 varchar(30) YES NULL
|
|||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11147,7 +11148,7 @@ f1 f2 f4 report
|
|||
4 NULL <------ 20 --------> v1 4
|
||||
<------------- 30 -----------> NULL <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11171,7 +11172,7 @@ f4 varchar(20) YES NULL
|
|||
report char(10) YES NULL
|
||||
DESCRIBE v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f4 report
|
||||
-1 ABC t1 0
|
||||
-1 ABC v1 0
|
||||
|
@ -11185,7 +11186,7 @@ f1 f4 report
|
|||
<------------- 30 -----------> <------ 20 --------> t1 5
|
||||
<------------- 30 -----------> <------ 20 --------> v1 5
|
||||
ABC <------ 20 --------> t1 6
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
|
||||
|
@ -11204,7 +11205,7 @@ f1 varchar(30) YES NULL
|
|||
f2 date YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
|
@ -11220,7 +11221,7 @@ f1 f4 report f2
|
|||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 1500-12-04
|
||||
ABC <------ 20 --------> v1 7 1500-12-04
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11254,7 +11255,7 @@ f1 varchar(30) YES NULL
|
|||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f4 report f2
|
||||
-1 ABC t1 0 NULL
|
||||
-1 ABC v1 0 NULL
|
||||
|
@ -11269,10 +11270,10 @@ f1 f4 report f2
|
|||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
|
||||
ABC <------ 20 --------> t1 6 NULL
|
||||
ABC <------ 20 --------> t1 7 NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033
|
||||
ABC <------ 20 --------> v1 7 NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033
|
||||
ABC <------ 20 --------> v1 8 -0.00033
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11287,8 +11288,8 @@ f1 f2 f4 report
|
|||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
|
||||
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
|
||||
|
@ -11311,7 +11312,7 @@ f1 varchar(30) YES NULL
|
|||
f2 float YES NULL
|
||||
f4 varchar(20) YES NULL
|
||||
report char(10) YES NULL
|
||||
SELECT * FROM t1 order by f1, report;
|
||||
SELECT * FROM t1;
|
||||
f1 f4 report f2 f3
|
||||
-1 ABC t1 0 NULL NULL
|
||||
-1 ABC v1 0 NULL NULL
|
||||
|
@ -11326,12 +11327,12 @@ f1 f4 report f2 f3
|
|||
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
|
||||
ABC <------ 20 --------> t1 6 NULL NULL
|
||||
ABC <------ 20 --------> t1 7 NULL NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> t1 9 -0.00033 -2.20
|
||||
ABC <------ 20 --------> v1 7 NULL NULL
|
||||
ABC <------ 20 --------> t1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> v1 8 -0.00033 NULL
|
||||
ABC <------ 20 --------> t1 9 -0.00033 -2.20
|
||||
ABC <------ 20 --------> v1 9a -0.00033 NULL
|
||||
SELECT * FROM v1 order by f1, report;
|
||||
SELECT * FROM v1;
|
||||
f1 f2 f4 report
|
||||
-1 NULL ABC t1 0
|
||||
-1 NULL ABC v1 0
|
||||
|
@ -11346,10 +11347,10 @@ f1 f2 f4 report
|
|||
<------------- 30 -----------> NULL <------ 20 --------> v1 5
|
||||
ABC NULL <------ 20 --------> t1 6
|
||||
ABC NULL <------ 20 --------> t1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> t1 9
|
||||
ABC NULL <------ 20 --------> v1 7
|
||||
ABC -0.00033 <------ 20 --------> t1 8
|
||||
ABC -0.00033 <------ 20 --------> v1 8
|
||||
ABC -0.00033 <------ 20 --------> t1 9
|
||||
ABC -0.00033 <------ 20 --------> v1 9a
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
|
@ -11364,10 +11365,10 @@ DESCRIBE v1;
|
|||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
ABC 3
|
||||
SELECT * FROM v1 order by 2;
|
||||
SELECT * FROM v1;
|
||||
f1 my_sqrt
|
||||
ABC 1.7320508075689
|
||||
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
|
||||
|
@ -11380,21 +11381,21 @@ DESCRIBE v1;
|
|||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM t1 order by f1, f2;
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
ABC 3
|
||||
ABC DEF
|
||||
SELECT * FROM v1 order by 2;
|
||||
SELECT * FROM v1;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
ABC 0
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE VIEW v2 AS SELECT SQRT('DEF');
|
||||
SELECT * FROM v2 order by 1;
|
||||
SELECT * FROM v2;
|
||||
SQRT('DEF')
|
||||
0
|
||||
Warnings:
|
||||
|
@ -11404,27 +11405,27 @@ DESCRIBE v2;
|
|||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES NULL
|
||||
my_sqrt double YES NULL
|
||||
SELECT * FROM v2 order by 2;
|
||||
SELECT * FROM v2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.7320508075689
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
SELECT * FROM t2;
|
||||
f1 my_sqrt
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
SELECT * FROM t2 order by 2;
|
||||
SELECT * FROM t2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
SELECT * FROM t2 order by 2;
|
||||
SELECT * FROM t2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
ABC 0
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP VIEW v1;
|
||||
|
|
0
mysql-test/suite/funcs_1/storedproc/storedproc_02.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_02.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_03.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_03.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_07.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_07.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_08.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_08.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_02.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_02.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_03.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_03.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_07.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_07.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_10.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/innodb_storedproc_10.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_02.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_02.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_03.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_03.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_06.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_06.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_07.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_07.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_08.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_08.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_10.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/memory_storedproc_10.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_02.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_02.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_03.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_03.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_06.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_06.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_07.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_07.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_08.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_08.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_10.test
Normal file → Executable file
0
mysql-test/suite/funcs_1/t/myisam_storedproc_10.test
Normal file → Executable file
|
@ -273,7 +273,7 @@ let $message= Testcase 3.5.1.8:;
|
|||
|
||||
# Can't create a trigger in a different database
|
||||
use test;
|
||||
--error 1435
|
||||
--error 1146
|
||||
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
|
||||
for each row set @ret_trg6_2 = 5;
|
||||
|
||||
|
|
|
@ -606,7 +606,8 @@ let $col_type= my_year;
|
|||
|
||||
|
||||
# 1.1.6. CAST --> DECIMAL
|
||||
let $target_type= DECIMAL;
|
||||
# Set the following to (37,2) since the default was changed to (10,0) - OBN
|
||||
let $target_type= DECIMAL(37,2);
|
||||
#
|
||||
let $col_type= my_char_30;
|
||||
--source suite/funcs_1/views/fv_cast.inc
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
eval $indext2;
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
|
||||
# Both transaction are able to update the tables
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DROP TABLE t1, t2;
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
eval $indext2;
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE fill_t1 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t1() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT count(*)/2 INTO res FROM t1;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CREATE PROCEDURE fill_t2 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t2() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT count(*)/2 INTO res FROM t2;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
DELIMITER ;|
|
||||
CALL fill_t1 (10);
|
||||
CALL fill_t2 (10);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
# With the two separate selects (without join) the differs from
|
||||
# that select with join.
|
||||
|
||||
# Both transaction are able to update the tables
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT k from t1 WHERE k < half_t1();
|
||||
SELECT k from t1 WHERE k >= half_t1();
|
||||
UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k < half_t1() AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k >= half_t1() AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP TABLE t1, t2;
|
||||
#DROP VIEW v1;
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
eval $indext2;
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE fill_t1 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t1() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT MOD(k,2) INTO res FROM t1;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CREATE PROCEDURE fill_t2 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t2() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT MOD(k,2) INTO res FROM t2;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
DELIMITER ;|
|
||||
eval CALL fill_t1 ($nbrows);
|
||||
eval CALL fill_t2 ($nbrows);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
# With the two separate selects (without join) the differs from
|
||||
# that select with join.
|
||||
|
||||
# Both transaction are able to update the tables
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k LOCK IN SHARE MODE;
|
||||
UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k % 2 = 1 AND t1.k = t2.k;
|
||||
SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
|
||||
SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k;
|
||||
SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
|
||||
SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
|
||||
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k;
|
||||
SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k;
|
||||
SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
eval $indext2;
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE fill_t1 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t1() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT MOD(k,2) INTO res FROM t1;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CREATE PROCEDURE fill_t2 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t2() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT MOD(k,2) INTO res FROM t2;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
DELIMITER ;|
|
||||
eval CALL fill_t1 ($nbrows);
|
||||
eval CALL fill_t2 ($nbrows);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
# With the two separate selects (without join) the differs from
|
||||
# that select with join.
|
||||
|
||||
# Both transaction are able to update the tables
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
#SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k FOR UPDATE;
|
||||
DELETE FROM t1 WHERE t1.k % 2 = 1;
|
||||
SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
|
||||
SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k;
|
||||
SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
|
||||
SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
|
||||
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k;
|
||||
SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k;
|
||||
SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
eval $indext2;
|
||||
DELIMITER |;
|
||||
|
||||
CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
|
||||
FOR EACH ROW BEGIN
|
||||
UPDATE t1 SET l = NEW.i WHERE i = OLD.i;
|
||||
END;
|
||||
|
|
||||
|
||||
DELIMITER ;|
|
||||
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
# With the two separate selects (without join) the differs from
|
||||
# that select with join.
|
||||
|
||||
# Both transaction are able to update the tables
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE t2 SET t2.i=225 WHERE t2.i=125;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t2 SET t2.i=223 WHERE t2.i=123;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE t2 SET t2.i=226 WHERE t2.i=126;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t2 SET t2.i=224 WHERE t2.i=124;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DROP TABLE t1, t2;
|
||||
#DROP VIEW v1;
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
eval $indext2;
|
||||
CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
# With the two separate selects (without join) the differs from
|
||||
# that select with join.
|
||||
|
||||
# Both transaction are able to update the tables
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE v1 SET i=325 where i=125;
|
||||
SELECT * FROM v1 ORDER BY i,l;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE v1 SET i=323 where i=123;
|
||||
SELECT * FROM v1 ORDER BY i,l;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE v1 SET i=326 where i=126;
|
||||
SELECT * FROM v1 ORDER BY i,l;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE v1 SET i=324 where i=124;
|
||||
SELECT * FROM v1 ORDER BY i,l;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP TABLE t1, t2;
|
||||
#DROP VIEW v1;
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
eval $indext2;
|
||||
CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
# With the two separate selects (without join) the differs from
|
||||
# that select with join.
|
||||
|
||||
# Both transaction are able to update the tables
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
#UPDATE v1 SET i=325 where i=125;
|
||||
#SELECT * FROM v1 ORDER BY i,l;
|
||||
#SELECT * FROM t1 ORDER BY t1.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE v1 SET i=323 where i=123;
|
||||
SELECT * FROM v1 ORDER BY i,l;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE v1 SET i=324 where i=124;
|
||||
SELECT * FROM v1 ORDER BY i,l;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP TABLE t1, t2;
|
||||
#DROP VIEW v1;
|
||||
|
|
@ -1,126 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP PROCEDURE IF EXISTS stp_t;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
CONNECT (root2, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
INSERT INTO t1 VALUES (5,127,5,127);
|
||||
INSERT INTO t1 VALUES (6,128,6,128);
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
INSERT INTO t2 VALUES (5,127,5,127);
|
||||
INSERT INTO t2 VALUES (6,128,6,128);
|
||||
eval $indext2;
|
||||
CREATE VIEW v1 AS SELECT t1.i from t1;
|
||||
DELIMITER |;
|
||||
|
||||
CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA
|
||||
BEGIN
|
||||
UPDATE t2 SET i = p2 WHERE i = p1;
|
||||
UPDATE v1 SET i = p2 WHERE i = p1;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
END;
|
||||
|
|
||||
|
||||
DELIMITER ;|
|
||||
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
CALL stp_t (125, 225);
|
||||
|
||||
--echo connection root2;
|
||||
CONNECTION root2;
|
||||
CALL stp_t (127, 227);
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
CALL stp_t (123, 223);
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
CALL stp_t (126, 226);
|
||||
|
||||
--echo connection root2;
|
||||
CONNECTION root2;
|
||||
CALL stp_t (128, 228);
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
CALL stp_t (124, 224);
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root2;
|
||||
CONNECTION root2;
|
||||
DELETE FROM t1 WHERE t1.i=228;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
COMMIT;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
|
||||
--echo connection root2;
|
||||
CONNECTION root2;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
DISCONNECT root2;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
--disable_warnings
|
||||
DROP VIEW v1;
|
||||
DROP PROCEDURE stp_t;
|
||||
DROP TABLE t1, t2;
|
||||
--enable_warnings
|
|
@ -1,99 +0,0 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
SET autocommit=0;
|
||||
# Create additional connections used through test
|
||||
CONNECT (root1, localhost, root,,);
|
||||
SET autocommit=0;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
eval $indext1;
|
||||
eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
eval $indext2;
|
||||
CREATE VIEW v1 AS SELECT t1.i from t1;
|
||||
DELIMITER |;
|
||||
|
||||
CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
|
||||
FOR EACH ROW BEGIN
|
||||
UPDATE v1 SET i = NEW.i WHERE i = OLD.i;
|
||||
END;
|
||||
|
|
||||
|
||||
DELIMITER ;|
|
||||
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
eval EXPLAIN $select;
|
||||
eval $select;
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE t2 SET t2.i=225 WHERE t2.i=125;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t2 SET t2.i=223 WHERE t2.i=123;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
UPDATE t2 SET t2.i=226 WHERE t2.i=126;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
UPDATE t2 SET t2.i=224 WHERE t2.i=124;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
COMMIT;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
|
||||
--echo connection root1;
|
||||
CONNECTION root1;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
DISCONNECT root1;
|
||||
--echo connection default;
|
||||
CONNECTION default;
|
||||
DROP TABLE t1, t2;
|
||||
DROP VIEW v1;
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
|
||||
1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
COMMIT;
|
||||
connection root1;
|
||||
ROLLBACK;
|
||||
connection default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
DROP TABLE t1, t2;
|
||||
SET @@global.innodb_table_locks= @table_locks;
|
|
@ -1,32 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
|
@ -1,32 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
|
@ -1,142 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
|
||||
1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
COMMIT;
|
||||
connection root1;
|
||||
ROLLBACK;
|
||||
connection default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
DROP TABLE t1, t2;
|
||||
SET @@global.innodb_table_locks= @table_locks;
|
|
@ -1,32 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
|
||||
SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
|
@ -1,97 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE PROCEDURE fill_t1 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t1() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT count(*)/2 INTO res FROM t1;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CREATE PROCEDURE fill_t2 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t2() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT count(*)/2 INTO res FROM t2;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CALL fill_t1 (10);
|
||||
CALL fill_t2 (10);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 10 Using where; Using index
|
||||
1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where; Using index
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
i i
|
||||
connection root1;
|
||||
SELECT k from t1 WHERE k < half_t1();
|
||||
k
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
SELECT k from t1 WHERE k >= half_t1();
|
||||
k
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k < half_t1() AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
0 1111 0 100
|
||||
1 1111 1 101
|
||||
2 1111 2 102
|
||||
3 1111 3 103
|
||||
4 1111 4 104
|
||||
5 105 5 105
|
||||
6 106 6 106
|
||||
7 107 7 107
|
||||
8 108 8 108
|
||||
9 109 9 109
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
0 2222 0 100
|
||||
1 2222 1 101
|
||||
2 2222 2 102
|
||||
3 2222 3 103
|
||||
4 2222 4 104
|
||||
5 105 5 105
|
||||
6 106 6 106
|
||||
7 107 7 107
|
||||
8 108 8 108
|
||||
9 109 9 109
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k >= half_t1() AND t2.i=t1.i;
|
|
@ -1,145 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE PROCEDURE fill_t1 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t1() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT MOD(k,2) INTO res FROM t1;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CREATE PROCEDURE fill_t2 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t2() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT MOD(k,2) INTO res FROM t2;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CALL fill_t1 (40);
|
||||
CALL fill_t2 (40);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index PRIMARY ixi 5 NULL 40 Using where; Using index
|
||||
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
|
||||
i i
|
||||
100 100
|
||||
102 102
|
||||
104 104
|
||||
106 106
|
||||
108 108
|
||||
110 110
|
||||
112 112
|
||||
114 114
|
||||
116 116
|
||||
118 118
|
||||
120 120
|
||||
122 122
|
||||
124 124
|
||||
126 126
|
||||
128 128
|
||||
130 130
|
||||
132 132
|
||||
134 134
|
||||
136 136
|
||||
138 138
|
||||
connection root1;
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k LOCK IN SHARE MODE;
|
||||
i i
|
||||
101 101
|
||||
103 103
|
||||
105 105
|
||||
107 107
|
||||
109 109
|
||||
111 111
|
||||
113 113
|
||||
115 115
|
||||
117 117
|
||||
119 119
|
||||
121 121
|
||||
123 123
|
||||
125 125
|
||||
127 127
|
||||
129 129
|
||||
131 131
|
||||
133 133
|
||||
135 135
|
||||
137 137
|
||||
139 139
|
||||
UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k % 2 = 1 AND t1.k = t2.k;
|
||||
SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
|
||||
k i j l
|
||||
0 100 0 100
|
||||
1 1111 1 101
|
||||
2 102 2 102
|
||||
3 1111 3 103
|
||||
4 104 4 104
|
||||
5 1111 5 105
|
||||
6 106 6 106
|
||||
7 1111 7 107
|
||||
8 108 8 108
|
||||
9 1111 9 109
|
||||
10 110 10 110
|
||||
11 1111 11 111
|
||||
12 112 12 112
|
||||
13 1111 13 113
|
||||
14 114 14 114
|
||||
15 1111 15 115
|
||||
16 116 16 116
|
||||
17 1111 17 117
|
||||
18 118 18 118
|
||||
19 1111 19 119
|
||||
SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
|
||||
k i j l
|
||||
0 100 0 100
|
||||
1 2222 1 101
|
||||
2 102 2 102
|
||||
3 2222 3 103
|
||||
4 104 4 104
|
||||
5 2222 5 105
|
||||
6 106 6 106
|
||||
7 2222 7 107
|
||||
8 108 8 108
|
||||
9 2222 9 109
|
||||
10 110 10 110
|
||||
11 2222 11 111
|
||||
12 112 12 112
|
||||
13 2222 13 113
|
||||
14 114 14 114
|
||||
15 2222 15 115
|
||||
16 116 16 116
|
||||
17 2222 17 117
|
||||
18 118 18 118
|
||||
19 2222 19 119
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k;
|
|
@ -1,113 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE PROCEDURE fill_t1 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t1() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT MOD(k,2) INTO res FROM t1;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CREATE PROCEDURE fill_t2 (IN upb int)
|
||||
BEGIN
|
||||
DECLARE cnt int DEFAULT 0;
|
||||
WHILE cnt < upb DO
|
||||
INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
|
||||
SET cnt= cnt+1;
|
||||
END WHILE;
|
||||
END;
|
||||
|
|
||||
CREATE FUNCTION half_t2() RETURNS int
|
||||
BEGIN
|
||||
DECLARE res int DEFAULT 0;
|
||||
SELECT MOD(k,2) INTO res FROM t2;
|
||||
RETURN res;
|
||||
END;
|
||||
|
|
||||
CALL fill_t1 (40);
|
||||
CALL fill_t2 (40);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index PRIMARY ixi 5 NULL 40 Using where; Using index
|
||||
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
|
||||
i i
|
||||
100 100
|
||||
102 102
|
||||
104 104
|
||||
106 106
|
||||
108 108
|
||||
110 110
|
||||
112 112
|
||||
114 114
|
||||
116 116
|
||||
118 118
|
||||
120 120
|
||||
122 122
|
||||
124 124
|
||||
126 126
|
||||
128 128
|
||||
130 130
|
||||
132 132
|
||||
134 134
|
||||
136 136
|
||||
138 138
|
||||
connection root1;
|
||||
DELETE FROM t1 WHERE t1.k % 2 = 1;
|
||||
SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
|
||||
k i j l
|
||||
0 100 0 100
|
||||
2 102 2 102
|
||||
4 104 4 104
|
||||
6 106 6 106
|
||||
8 108 8 108
|
||||
10 110 10 110
|
||||
12 112 12 112
|
||||
14 114 14 114
|
||||
16 116 16 116
|
||||
18 118 18 118
|
||||
SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
|
||||
k i j l
|
||||
0 100 0 100
|
||||
1 101 1 101
|
||||
2 102 2 102
|
||||
3 103 3 103
|
||||
4 104 4 104
|
||||
5 105 5 105
|
||||
6 106 6 106
|
||||
7 107 7 107
|
||||
8 108 8 108
|
||||
9 109 9 109
|
||||
10 110 10 110
|
||||
11 111 11 111
|
||||
12 112 12 112
|
||||
13 113 13 113
|
||||
14 114 14 114
|
||||
15 115 15 115
|
||||
16 116 16 116
|
||||
17 117 17 117
|
||||
18 118 18 118
|
||||
19 119 19 119
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k;
|
|
@ -1,151 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
|
||||
FOR EACH ROW BEGIN
|
||||
UPDATE t1 SET l = NEW.i WHERE i = OLD.i;
|
||||
END;
|
||||
|
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
|
||||
SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
i
|
||||
123
|
||||
124
|
||||
connection root1;
|
||||
UPDATE t2 SET t2.i=225 WHERE t2.i=125;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 225
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
UPDATE t2 SET t2.i=223 WHERE t2.i=123;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 223
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
UPDATE t2 SET t2.i=226 WHERE t2.i=126;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 225
|
||||
4 126 4 226
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
UPDATE t2 SET t2.i=224 WHERE t2.i=124;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 223
|
||||
2 124 2 224
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 225
|
||||
4 126 4 226
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 223
|
||||
2 124 2 224
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
COMMIT;
|
||||
connection root1;
|
||||
ROLLBACK;
|
||||
connection default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 223
|
||||
2 124 2 224
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 223
|
||||
2 124 2 224
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
DROP TABLE t1, t2;
|
||||
SET @@global.innodb_table_locks= @table_locks;
|
|
@ -1,37 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t2 (i);
|
||||
CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
|
||||
FOR EACH ROW BEGIN
|
||||
UPDATE t1 SET l = NEW.i WHERE i = OLD.i;
|
||||
END;
|
||||
|
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
i
|
||||
123
|
||||
124
|
||||
connection root1;
|
||||
UPDATE t2 SET t2.i=225 WHERE t2.i=125;
|
|
@ -1,34 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
|
||||
1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE v1 SET i=325 where i=125;
|
|
@ -1,40 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
|
||||
1 SIMPLE t2 index NULL PRIMARY 4 NULL 4 Using index
|
||||
SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
|
||||
i
|
||||
123
|
||||
124
|
||||
123
|
||||
124
|
||||
123
|
||||
124
|
||||
123
|
||||
124
|
||||
connection root1;
|
||||
UPDATE v1 SET i=325 where i=125;
|
|
@ -1,48 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
|
||||
1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
UPDATE v1 SET i=323 where i=123;
|
|
@ -1,40 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
|
||||
1 SIMPLE t2 index NULL PRIMARY 4 NULL 4 Using index
|
||||
SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
|
||||
i
|
||||
123
|
||||
124
|
||||
123
|
||||
124
|
||||
123
|
||||
124
|
||||
123
|
||||
124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
|
@ -1,312 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
INSERT INTO t1 VALUES (5,127,5,127);
|
||||
INSERT INTO t1 VALUES (6,128,6,128);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
INSERT INTO t2 VALUES (5,127,5,127);
|
||||
INSERT INTO t2 VALUES (6,128,6,128);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE VIEW v1 AS SELECT t1.i from t1;
|
||||
CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA
|
||||
BEGIN
|
||||
UPDATE t2 SET i = p2 WHERE i = p1;
|
||||
UPDATE v1 SET i = p2 WHERE i = p1;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
END;
|
||||
|
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 6 Using where; Using index
|
||||
SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
i
|
||||
123
|
||||
124
|
||||
connection root1;
|
||||
CALL stp_t (125, 225);
|
||||
i
|
||||
123
|
||||
124
|
||||
126
|
||||
127
|
||||
128
|
||||
225
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
connection root2;
|
||||
CALL stp_t (127, 227);
|
||||
i
|
||||
123
|
||||
124
|
||||
125
|
||||
126
|
||||
128
|
||||
227
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 227 5 127
|
||||
6 128 6 128
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 227 5 127
|
||||
6 128 6 128
|
||||
connection default;
|
||||
CALL stp_t (123, 223);
|
||||
i
|
||||
124
|
||||
125
|
||||
126
|
||||
127
|
||||
128
|
||||
223
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
connection root1;
|
||||
CALL stp_t (126, 226);
|
||||
i
|
||||
123
|
||||
124
|
||||
127
|
||||
128
|
||||
225
|
||||
226
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
connection root2;
|
||||
CALL stp_t (128, 228);
|
||||
i
|
||||
123
|
||||
124
|
||||
125
|
||||
126
|
||||
227
|
||||
228
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 227 5 127
|
||||
6 228 6 128
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 227 5 127
|
||||
6 228 6 128
|
||||
connection default;
|
||||
CALL stp_t (124, 224);
|
||||
i
|
||||
125
|
||||
126
|
||||
127
|
||||
128
|
||||
223
|
||||
224
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
connection root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
connection root2;
|
||||
DELETE FROM t1 WHERE t1.i=228;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 227 5 127
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 227 5 127
|
||||
6 228 6 128
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
COMMIT;
|
||||
connection root1;
|
||||
ROLLBACK;
|
||||
connection root1;
|
||||
COMMIT;
|
||||
connection default;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
125
|
||||
126
|
||||
127
|
||||
128
|
||||
223
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
connection root1;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
125
|
||||
126
|
||||
127
|
||||
128
|
||||
223
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 127 5 127
|
||||
6 128 6 128
|
||||
connection root2;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
123
|
||||
124
|
||||
125
|
||||
126
|
||||
227
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 227 5 127
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
5 227 5 127
|
||||
6 228 6 128
|
||||
connection default;
|
||||
DROP TABLE t1, t2;
|
||||
DROP VIEW v1;
|
||||
SET @@global.innodb_table_locks= @table_locks;
|
|
@ -1,47 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
INSERT INTO t1 VALUES (5,127,5,127);
|
||||
INSERT INTO t1 VALUES (6,128,6,128);
|
||||
#CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
INSERT INTO t2 VALUES (5,127,5,127);
|
||||
INSERT INTO t2 VALUES (6,128,6,128);
|
||||
#CREATE INDEX ixi ON t2 (i);
|
||||
CREATE VIEW v1 AS SELECT t1.i from t1;
|
||||
CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA
|
||||
BEGIN
|
||||
UPDATE t2 SET i = p2 WHERE i = p1;
|
||||
UPDATE v1 SET i = p2 WHERE i = p1;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
END;
|
||||
|
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where
|
||||
SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
i
|
||||
123
|
||||
124
|
||||
connection root1;
|
||||
CALL stp_t (125, 225);
|
|
@ -1,183 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
CREATE VIEW v1 AS SELECT t1.i from t1;
|
||||
CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
|
||||
FOR EACH ROW BEGIN
|
||||
UPDATE v1 SET i = NEW.i WHERE i = OLD.i;
|
||||
END;
|
||||
|
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
|
||||
SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
i
|
||||
123
|
||||
124
|
||||
connection root1;
|
||||
UPDATE t2 SET t2.i=225 WHERE t2.i=125;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
123
|
||||
124
|
||||
126
|
||||
225
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
UPDATE t2 SET t2.i=223 WHERE t2.i=123;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
124
|
||||
125
|
||||
126
|
||||
223
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
UPDATE t2 SET t2.i=226 WHERE t2.i=126;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
123
|
||||
124
|
||||
225
|
||||
226
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
UPDATE t2 SET t2.i=224 WHERE t2.i=124;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
125
|
||||
126
|
||||
223
|
||||
224
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
COMMIT;
|
||||
connection root1;
|
||||
ROLLBACK;
|
||||
connection default;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
125
|
||||
126
|
||||
223
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
SELECT * FROM v1 ORDER BY i;
|
||||
i
|
||||
125
|
||||
126
|
||||
223
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
DROP TABLE t1, t2;
|
||||
DROP VIEW v1;
|
||||
SET @@global.innodb_table_locks= @table_locks;
|
|
@ -1,38 +0,0 @@
|
|||
SELECT @@global.innodb_table_locks into @table_locks;
|
||||
SET @@global.innodb_table_locks= OFF;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t2 (i);
|
||||
CREATE VIEW v1 AS SELECT t1.i from t1;
|
||||
CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
|
||||
FOR EACH ROW BEGIN
|
||||
UPDATE v1 SET i = NEW.i WHERE i = OLD.i;
|
||||
END;
|
||||
|
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
|
||||
i
|
||||
123
|
||||
124
|
||||
connection root1;
|
||||
UPDATE t2 SET t2.i=225 WHERE t2.i=125;
|
|
@ -1,139 +0,0 @@
|
|||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
|
||||
1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
COMMIT;
|
||||
connection root1;
|
||||
ROLLBACK;
|
||||
connection default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
DROP TABLE t1, t2;
|
|
@ -1,31 +0,0 @@
|
|||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
|
@ -1,30 +0,0 @@
|
|||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
#CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
|
@ -1,139 +0,0 @@
|
|||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET autocommit=0;
|
||||
SET autocommit=0;
|
||||
connection default;
|
||||
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
|
||||
INSERT INTO t1 VALUES (1,123,1,123);
|
||||
INSERT INTO t1 VALUES (2,124,2,124);
|
||||
INSERT INTO t1 VALUES (3,125,3,125);
|
||||
INSERT INTO t1 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t1 (i);
|
||||
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
|
||||
INSERT INTO t2 VALUES (1,123,1,123);
|
||||
INSERT INTO t2 VALUES (2,124,2,124);
|
||||
INSERT INTO t2 VALUES (3,125,3,125);
|
||||
INSERT INTO t2 VALUES (4,126,4,126);
|
||||
CREATE INDEX ixi ON t2 (i);
|
||||
COMMIT;
|
||||
SELECT @@global.tx_isolation;
|
||||
@@global.tx_isolation
|
||||
REPEATABLE-READ
|
||||
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
|
||||
1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where
|
||||
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
|
||||
i i
|
||||
123 123
|
||||
124 124
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 124 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
DELETE FROM t1 WHERE t1.i=226;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 123 1 123
|
||||
2 124 2 124
|
||||
3 225 3 125
|
||||
4 226 4 126
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE t1.i=224;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
COMMIT;
|
||||
connection root1;
|
||||
ROLLBACK;
|
||||
connection default;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection root1;
|
||||
SELECT * FROM t1 ORDER BY t1.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
SELECT * FROM t2 ORDER BY t2.k;
|
||||
k i j l
|
||||
1 223 1 123
|
||||
2 224 2 124
|
||||
3 125 3 125
|
||||
4 126 4 126
|
||||
connection default;
|
||||
DROP TABLE t1, t2;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue