mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge
mysql-test/r/union.result: Auto merged mysql-test/t/union.test: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_derived.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/subselect.result: SCCS merged mysql-test/t/subselect.test: SCCS merged
This commit is contained in:
@ -21,8 +21,9 @@ benchdir_root= $(prefix)
|
||||
testdir = $(benchdir_root)/mysql-test
|
||||
EXTRA_SCRIPTS = mysql-test-run.sh install_test_db.sh
|
||||
EXTRA_DIST = $(EXTRA_SCRIPTS)
|
||||
test_SCRIPTS = mysql-test-run install_test_db
|
||||
CLEANFILES = $(test_SCRIPTS)
|
||||
test_SCRIPTS = mysql-test-run install_test_db
|
||||
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
|
||||
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
|
||||
|
||||
dist-hook:
|
||||
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
|
||||
@ -32,6 +33,8 @@ dist-hook:
|
||||
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data
|
||||
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) \
|
||||
@ -49,6 +52,11 @@ install-data-local:
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
|
||||
|
||||
std_data/%.pem:
|
||||
@CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
|
||||
|
||||
|
||||
SUFFIXES = .sh
|
||||
|
||||
|
9
mysql-test/include/check_var_limit.inc
Normal file
9
mysql-test/include/check_var_limit.inc
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# Check that second part of $LIMIT is between $MIN_LIMIT and $MAX_LIMIT
|
||||
# This is useful to check that a variable from SHOW_VARIABLES is within
|
||||
# certain limits. Check query_cache_merge.test for an example of using this.
|
||||
#
|
||||
-- require r/check_var_limit.require
|
||||
disable_query_log;
|
||||
eval select SUBSTRING_INDEX("$LIMIT", "\\t", -1) BETWEEN $MIN_LIMIT AND $MAX_LIMIT as "limit";
|
||||
enable_query_log;
|
@ -1,4 +0,0 @@
|
||||
-- require r/have_openssl_2.require
|
||||
disable_query_log;
|
||||
SHOW STATUS LIKE "Ssl_cipher";
|
||||
enable_query_log;
|
@ -16,6 +16,9 @@ USE_MANAGER=0
|
||||
MY_TZ=GMT-3
|
||||
TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
|
||||
|
||||
# For query_cache test
|
||||
ulimit -n 1024
|
||||
|
||||
#++
|
||||
# Program Definitions
|
||||
#--
|
||||
@ -210,7 +213,6 @@ CHARACTER_SET=latin1
|
||||
DBUSER=""
|
||||
START_WAIT_TIMEOUT=10
|
||||
STOP_WAIT_TIMEOUT=10
|
||||
TEST_REPLICATION=0
|
||||
MYSQL_TEST_SSL_OPTS=""
|
||||
|
||||
while test $# -gt 0; do
|
||||
@ -254,12 +256,6 @@ while test $# -gt 0; do
|
||||
--start-and-exit)
|
||||
START_AND_EXIT=1
|
||||
;;
|
||||
--skip-innodb)
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-innodb"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-innodb" ;;
|
||||
--skip-bdb)
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-bdb"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-bdb" ;;
|
||||
--skip-rpl) NO_SLAVE=1 ;;
|
||||
--skip-test=*) SKIP_TEST=`$ECHO "$1" | $SED -e "s;--skip-test=;;"`;;
|
||||
--do-test=*) DO_TEST=`$ECHO "$1" | $SED -e "s;--do-test=;;"`;;
|
||||
@ -288,9 +284,6 @@ while test $# -gt 0; do
|
||||
--user-test=*)
|
||||
USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
|
||||
;;
|
||||
--rpl)
|
||||
TEST_REPLICATION=1
|
||||
;;
|
||||
--mysqld=*)
|
||||
TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP"
|
||||
@ -435,6 +428,11 @@ if [ x$SOURCE_DIST = x1 ] ; then
|
||||
else
|
||||
MYSQL_TEST="$BASEDIR/client/mysqltest"
|
||||
fi
|
||||
if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
|
||||
MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK"
|
||||
else
|
||||
MYSQL_DUMP="$BASEDIR/client/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK"
|
||||
fi
|
||||
if [ -n "$STRACE_CLIENT" ]; then
|
||||
MYSQL_TEST="strace -o $MYSQL_TEST_DIR/var/log/mysqltest.strace $MYSQL_TEST"
|
||||
fi
|
||||
@ -456,6 +454,7 @@ else
|
||||
MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
|
||||
fi
|
||||
MYSQL_TEST="$BASEDIR/bin/mysqltest"
|
||||
MYSQL_DUMP="$BASEDIR/bin/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK"
|
||||
MYSQLADMIN="$BASEDIR/bin/mysqladmin"
|
||||
WAIT_PID="$BASEDIR/bin/mysql_waitpid"
|
||||
MYSQL_MANAGER="$BASEDIR/bin/mysqlmanager"
|
||||
@ -473,6 +472,8 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
export MYSQL_DUMP
|
||||
|
||||
if [ -z "$MASTER_MYSQLD" ]
|
||||
then
|
||||
MASTER_MYSQLD=$MYSQLD
|
||||
@ -839,7 +840,6 @@ start_master()
|
||||
/bin/sh $master_init_script
|
||||
fi
|
||||
cd $BASEDIR # for gcov
|
||||
#start master
|
||||
if [ -z "$DO_BENCH" ]
|
||||
then
|
||||
master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin \
|
||||
@ -858,6 +858,7 @@ start_master()
|
||||
--tmpdir=$MYSQL_TMP_DIR \
|
||||
--language=$LANGUAGE \
|
||||
--innodb_data_file_path=ibdata1:50M \
|
||||
--open-files-limit=1024 \
|
||||
$MASTER_40_ARGS \
|
||||
$SMALL_SERVER \
|
||||
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT"
|
||||
@ -1376,6 +1377,9 @@ fi
|
||||
|
||||
$ECHO "Starting Tests"
|
||||
|
||||
#
|
||||
# This can probably be deleted
|
||||
#
|
||||
if [ "$DO_BENCH" = 1 ]
|
||||
then
|
||||
BENCHDIR=$BASEDIR/sql-bench/
|
||||
@ -1407,17 +1411,10 @@ then
|
||||
if [ x$RECORD = x1 ]; then
|
||||
$ECHO "Will not run in record mode without a specific test case."
|
||||
else
|
||||
if [ x$TEST_REPLICATION = x1 ]; then
|
||||
for tf in `ls -1 $TESTDIR/*.$TESTSUFFIX | $SORT`
|
||||
do
|
||||
run_testcase $tf
|
||||
done
|
||||
else
|
||||
for tf in $TESTDIR/*.$TESTSUFFIX
|
||||
do
|
||||
run_testcase $tf
|
||||
done
|
||||
fi
|
||||
for tf in $TESTDIR/*.$TESTSUFFIX
|
||||
do
|
||||
run_testcase $tf
|
||||
done
|
||||
$RM -f $TIMEFILE # Remove for full test
|
||||
fi
|
||||
else
|
||||
|
@ -1114,3 +1114,34 @@ a b
|
||||
select * from t2;
|
||||
a b
|
||||
drop table t1,t2;
|
||||
create table t1 (x int not null, index(x)) type=bdb;
|
||||
insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
select * from t1 where x <= 10 and x >= 7;
|
||||
x
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
select * from t1 where x <= 10 and x >= 7 order by x;
|
||||
x
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
select * from t1 where x <= 10 and x >= 7 order by x desc;
|
||||
x
|
||||
10
|
||||
9
|
||||
8
|
||||
7
|
||||
select * from t1 where x <= 8 and x >= 5 order by x desc;
|
||||
x
|
||||
8
|
||||
7
|
||||
6
|
||||
5
|
||||
select * from t1 where x < 8 and x > 5 order by x desc;
|
||||
x
|
||||
7
|
||||
6
|
||||
drop table t1;
|
||||
|
2
mysql-test/r/check_var_limit.require
Normal file
2
mysql-test/r/check_var_limit.require
Normal file
@ -0,0 +1,2 @@
|
||||
limit
|
||||
1
|
@ -30,6 +30,7 @@ show tables;
|
||||
Tables_in_test
|
||||
update mysql.user set password=old_password("gambling2") where user="test";
|
||||
flush privileges;
|
||||
set password=old_password('gambling3');
|
||||
show tables;
|
||||
Tables_in_mysql
|
||||
columns_priv
|
||||
|
@ -312,3 +312,65 @@ SET SESSION table_type=default;
|
||||
drop table t1;
|
||||
create table t1 select x'4132';
|
||||
drop table t1;
|
||||
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
|
||||
insert into t1(a)values(1);
|
||||
insert into t1(a,b,c,d,e,f,g,h)
|
||||
values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data');
|
||||
select * from t1;
|
||||
a b c d e f g h
|
||||
1 NULL NULL NULL NULL NULL NULL NULL
|
||||
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data
|
||||
select a,
|
||||
ifnull(b,cast(-7 as signed)) as b,
|
||||
ifnull(c,cast(7 as unsigned)) as c,
|
||||
ifnull(d,cast('2000-01-01' as date)) as d,
|
||||
ifnull(e,cast('b' as char)) as e,
|
||||
ifnull(f,cast('2000-01-01' as datetime)) as f,
|
||||
ifnull(g,cast('5:4:3' as time)) as g,
|
||||
ifnull(h,cast('yet another binary data' as binary)) as h,
|
||||
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
|
||||
from t1;
|
||||
a b c d e f g h dd
|
||||
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
|
||||
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00
|
||||
create table t2
|
||||
select
|
||||
a,
|
||||
ifnull(b,cast(-7 as signed)) as b,
|
||||
ifnull(c,cast(7 as unsigned)) as c,
|
||||
ifnull(d,cast('2000-01-01' as date)) as d,
|
||||
ifnull(e,cast('b' as char)) as e,
|
||||
ifnull(f,cast('2000-01-01' as datetime)) as f,
|
||||
ifnull(g,cast('5:4:3' as time)) as g,
|
||||
ifnull(h,cast('yet another binary data' as binary)) as h,
|
||||
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
|
||||
from t1;
|
||||
explain t2;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
b bigint(11) 0
|
||||
c bigint(10) 0
|
||||
d date 0000-00-00
|
||||
e char(1)
|
||||
f datetime 0000-00-00 00:00:00
|
||||
g time 00:00:00
|
||||
h mediumblob
|
||||
dd time 00:00:00
|
||||
select * from t2;
|
||||
a b c d e f g h dd
|
||||
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
|
||||
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00
|
||||
drop table t1, t2;
|
||||
drop database if exists test_$1;
|
||||
create database test_$1;
|
||||
use test_$1;
|
||||
select database();
|
||||
database()
|
||||
test_$1
|
||||
drop database test_$1;
|
||||
select database();
|
||||
database()
|
||||
NULL
|
||||
select database();
|
||||
database()
|
||||
NULL
|
||||
|
@ -1433,7 +1433,7 @@ CYR CAPIT EM М М
|
||||
CYR CAPIT EN Н Н <09> Н
|
||||
CYR CAPIT O О О <09> О
|
||||
CYR CAPIT PE П П <09> П
|
||||
CYR CAPIT ER Р Р <09>
|
||||
CYR CAPIT ER Р Р <09> Р
|
||||
CYR CAPIT ES С С <09> С
|
||||
CYR CAPIT TE Т Т <09> Т
|
||||
CYR CAPIT U У У <09> У
|
||||
@ -1574,7 +1574,7 @@ CYR CAPIT EM
|
||||
CYR CAPIT EN <09> Н <09>
|
||||
CYR CAPIT O <09> О <09>
|
||||
CYR CAPIT PE <09> П <09>
|
||||
CYR CAPIT ER <09> Р <09>
|
||||
CYR CAPIT ER <09> Р <09>
|
||||
CYR CAPIT ES <09> С <09> !
|
||||
CYR CAPIT TE <09> Т <09> "
|
||||
CYR CAPIT U <09> У <09> #
|
||||
|
@ -19,3 +19,34 @@ SELECT * FROM t1;
|
||||
c1 c2 c3
|
||||
aaaabbbbcccc aaaabbbbcccc aaaabbbbcccc
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8, KEY key_a(a(3)));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(4) character set utf8 default NULL,
|
||||
KEY `key_a` (`a`(3))
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW KEYS FROM t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 key_a 1 a A NULL 9 NULL YES BTREE
|
||||
ALTER TABLE t1 CHANGE a a CHAR(4);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(4) default NULL,
|
||||
KEY `key_a` (`a`(3))
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW KEYS FROM t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 key_a 1 a A NULL 3 NULL YES BTREE
|
||||
ALTER TABLE t1 CHANGE a a CHAR(4) CHARACTER SET utf8;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(4) character set utf8 default NULL,
|
||||
KEY `key_a` (`a`(3))
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
SHOW KEYS FROM t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 key_a 1 a A NULL 9 NULL YES BTREE
|
||||
DROP TABLE t1;
|
||||
|
@ -16,16 +16,16 @@ EFF0EEE1E0
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
(
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> CHAR(32) CHARACTER SET koi8r NOT NULL
|
||||
);
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
) COMMENT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SHOW CREATE TABLE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Table Create Table
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CREATE TABLE `<60><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>` (
|
||||
`<60><><EFBFBD><EFBFBD>` char(32) character set koi8r NOT NULL default ''
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
`<60><><EFBFBD><EFBFBD>` char(32) character set koi8r NOT NULL default '' COMMENT '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>'
|
||||
) TYPE=MyISAM CHARSET=latin1 COMMENT='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
SHOW FIELDS FROM <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Field Type Null Key Default Extra
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> char(32)
|
||||
@ -36,8 +36,8 @@ Tables_in_test
|
||||
SHOW CREATE TABLE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Table Create Table
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CREATE TABLE `<60><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>` (
|
||||
`<60><><EFBFBD><EFBFBD>` char(32) character set koi8r NOT NULL default ''
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
`<60><><EFBFBD><EFBFBD>` char(32) character set koi8r NOT NULL default '' COMMENT '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>'
|
||||
) TYPE=MyISAM CHARSET=latin1 COMMENT='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
SHOW FIELDS FROM <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
Field Type Null Key Default Extra
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> char(32)
|
||||
@ -48,8 +48,8 @@ Tables_in_test
|
||||
SHOW CREATE TABLE таблица;
|
||||
Table Create Table
|
||||
таблица CREATE TABLE `таблица` (
|
||||
`поле` char(32) character set koi8r NOT NULL default ''
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
`поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий поля'
|
||||
) TYPE=MyISAM CHARSET=latin1 COMMENT='комментарий таблицы'
|
||||
SHOW FIELDS FROM таблица;
|
||||
Field Type Null Key Default Extra
|
||||
поле char(32)
|
||||
@ -70,3 +70,11 @@ SHOW TABLES IN
|
||||
Tables_in_<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SET CHARACTER SET koi8r;
|
||||
DROP DATABASE <20><><EFBFBD><EFBFBD>;
|
||||
SET NAMES koi8r;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
hex('<27><><EFBFBD><EFBFBD>')
|
||||
D4C5D3D4
|
||||
SET character_set_connection=cp1251;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
hex('<27><><EFBFBD><EFBFBD>')
|
||||
F2E5F1F2
|
||||
|
272
mysql-test/r/ctype_ucs.result
Normal file
272
mysql-test/r/ctype_ucs.result
Normal file
@ -0,0 +1,272 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
SET CHARACTER SET koi8r;
|
||||
CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES (_koi8r'<27>'), (X'2004');
|
||||
SELECT hex(word) FROM t1 ORDER BY word;
|
||||
hex(word)
|
||||
0420
|
||||
2004
|
||||
DELETE FROM t1;
|
||||
INSERT INTO t1 VALUES (X'042000200020'), (X'200400200020');
|
||||
SELECT hex(word) FROM t1 ORDER BY word;
|
||||
hex(word)
|
||||
0420
|
||||
2004
|
||||
DROP TABLE t1;
|
||||
SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'0421');
|
||||
LPAD(_ucs2 X'0420',10,_ucs2 X'0421')
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'04210422');
|
||||
LPAD(_ucs2 X'0420',10,_ucs2 X'04210422')
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'042104220423');
|
||||
LPAD(_ucs2 X'0420',10,_ucs2 X'042104220423')
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT LPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423');
|
||||
LPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423')
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'0421');
|
||||
RPAD(_ucs2 X'0420',10,_ucs2 X'0421')
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'04210422');
|
||||
RPAD(_ucs2 X'0420',10,_ucs2 X'04210422')
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'042104220423');
|
||||
RPAD(_ucs2 X'0420',10,_ucs2 X'042104220423')
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT RPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423');
|
||||
RPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423')
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
CREATE TABLE t1 SELECT
|
||||
LPAD(_ucs2 X'0420',10,_ucs2 X'0421') l,
|
||||
RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`l` char(10) character set ucs2 NOT NULL default '',
|
||||
`r` char(10) character set ucs2 NOT NULL default ''
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
SET NAMES koi8r;
|
||||
SET character_set_connection=ucs2;
|
||||
create table t1 (a varchar(10) character set ucs2, key(a));
|
||||
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
|
||||
explain select * from t1 where a like 'abc%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 21 NULL 1 Using where; Using index
|
||||
explain select * from t1 where a like concat('abc','%');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 21 NULL 1 Using where; Using index
|
||||
select * from t1 where a like "abc%";
|
||||
a
|
||||
abc
|
||||
abcd
|
||||
select * from t1 where a like concat("abc","%");
|
||||
a
|
||||
abc
|
||||
abcd
|
||||
select * from t1 where a like "ABC%";
|
||||
a
|
||||
abc
|
||||
abcd
|
||||
select * from t1 where a like "test%";
|
||||
a
|
||||
test
|
||||
select * from t1 where a like "te_t";
|
||||
a
|
||||
test
|
||||
select * from t1 where a like "%a%";
|
||||
a
|
||||
select * from t1 where a like "%abcd%";
|
||||
a
|
||||
abcd
|
||||
select * from t1 where a like "%abc\d%";
|
||||
a
|
||||
abcd
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
SELECT * FROM t1 WHERE a LIKE '%<25><><EFBFBD><EFBFBD>%';
|
||||
a
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT * FROM t1 WHERE a LIKE '%<25><><EFBFBD>%';
|
||||
a
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT * FROM t1 WHERE a LIKE '<27><><EFBFBD><EFBFBD>%';
|
||||
a
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SELECT * FROM t1 WHERE a LIKE '<27><><EFBFBD><EFBFBD>%' COLLATE ucs2_bin;
|
||||
a
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
|
||||
TYPE=MyISAM CHARACTER SET ucs2 COLLATE ucs2_general_ci;
|
||||
INSERT INTO t1 (word) VALUES ("cat");
|
||||
SELECT * FROM t1 WHERE word LIKE "c%";
|
||||
word
|
||||
cat
|
||||
SELECT * FROM t1 WHERE word LIKE "ca_";
|
||||
word
|
||||
cat
|
||||
SELECT * FROM t1 WHERE word LIKE "cat";
|
||||
word
|
||||
cat
|
||||
SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630025';
|
||||
word
|
||||
cat
|
||||
SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630061005F';
|
||||
word
|
||||
cat
|
||||
DROP TABLE t1;
|
||||
SET NAMES latin1;
|
||||
CREATE TABLE t1 (
|
||||
word VARCHAR(64),
|
||||
bar INT(11) default 0,
|
||||
PRIMARY KEY (word))
|
||||
TYPE=MyISAM
|
||||
CHARSET ucs2
|
||||
COLLATE ucs2_general_ci ;
|
||||
INSERT INTO t1 (word) VALUES ("aar");
|
||||
INSERT INTO t1 (word) VALUES ("a");
|
||||
INSERT INTO t1 (word) VALUES ("aardvar");
|
||||
INSERT INTO t1 (word) VALUES ("aardvark");
|
||||
INSERT INTO t1 (word) VALUES ("aardvara");
|
||||
INSERT INTO t1 (word) VALUES ("aardvarz");
|
||||
EXPLAIN SELECT * FROM t1 ORDER BY word;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
|
||||
SELECT * FROM t1 ORDER BY word;
|
||||
word bar
|
||||
a 0
|
||||
aar 0
|
||||
aardvar 0
|
||||
aardvara 0
|
||||
aardvark 0
|
||||
aardvarz 0
|
||||
EXPLAIN SELECT word FROM t1 ORDER BY word;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 128 NULL 6 Using index
|
||||
SELECT word FROM t1 ORDER by word;
|
||||
word
|
||||
a
|
||||
aar
|
||||
aardvar
|
||||
aardvara
|
||||
aardvark
|
||||
aardvarz
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
word VARCHAR(64) ,
|
||||
PRIMARY KEY (word))
|
||||
TYPE=MyISAM
|
||||
CHARSET ucs2
|
||||
COLLATE ucs2_general_ci;
|
||||
INSERT INTO t1 (word) VALUES ("aar");
|
||||
INSERT INTO t1 (word) VALUES ("a");
|
||||
INSERT INTO t1 (word) VALUES ("aardvar");
|
||||
INSERT INTO t1 (word) VALUES ("aardvark");
|
||||
INSERT INTO t1 (word) VALUES ("aardvara");
|
||||
INSERT INTO t1 (word) VALUES ("aardvarz");
|
||||
EXPLAIN SELECT * FROM t1 ORDER BY WORD;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 128 NULL 6 Using index
|
||||
SELECT * FROM t1 ORDER BY word;
|
||||
word
|
||||
a
|
||||
aar
|
||||
aardvar
|
||||
aardvara
|
||||
aardvark
|
||||
aardvarz
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
word TEXT,
|
||||
bar INT(11) AUTO_INCREMENT,
|
||||
PRIMARY KEY (bar))
|
||||
TYPE=MyISAM
|
||||
CHARSET ucs2
|
||||
COLLATE ucs2_general_ci ;
|
||||
INSERT INTO t1 (word) VALUES ("aar");
|
||||
INSERT INTO t1 (word) VALUES ("a" );
|
||||
INSERT INTO t1 (word) VALUES ("aardvar");
|
||||
INSERT INTO t1 (word) VALUES ("aardvark");
|
||||
INSERT INTO t1 (word) VALUES ("aardvara");
|
||||
INSERT INTO t1 (word) VALUES ("aardvarz");
|
||||
EXPLAIN SELECT * FROM t1 ORDER BY word;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
|
||||
SELECT * FROM t1 ORDER BY word;
|
||||
word bar
|
||||
a 2
|
||||
aar 1
|
||||
aardvar 3
|
||||
aardvara 5
|
||||
aardvark 4
|
||||
aardvarz 6
|
||||
EXPLAIN SELECT word FROM t1 ORDER BY word;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
|
||||
SELECT word FROM t1 ORDER BY word;
|
||||
word
|
||||
a
|
||||
aar
|
||||
aardvar
|
||||
aardvara
|
||||
aardvark
|
||||
aardvarz
|
||||
DROP TABLE t1;
|
@ -1,4 +1,5 @@
|
||||
drop table if exists t1;
|
||||
set names ujis;
|
||||
create table t1 (c text character set ujis);
|
||||
insert into t1 values (0xa4a2),(0xa4a3);
|
||||
select hex(left(c,1)) from t1 group by c;
|
||||
@ -6,3 +7,60 @@ hex(left(c,1))
|
||||
A4A2
|
||||
A4A3
|
||||
drop table t1;
|
||||
select locate(0xa2a1,0xa1a2a1a3);
|
||||
locate(0xa2a1,0xa1a2a1a3)
|
||||
2
|
||||
select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3);
|
||||
locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3)
|
||||
0
|
||||
select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin);
|
||||
locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin)
|
||||
0
|
||||
select locate('he','hello');
|
||||
locate('he','hello')
|
||||
1
|
||||
select locate('he','hello',2);
|
||||
locate('he','hello',2)
|
||||
0
|
||||
select locate('lo','hello',2);
|
||||
locate('lo','hello',2)
|
||||
4
|
||||
select locate('HE','hello');
|
||||
locate('HE','hello')
|
||||
1
|
||||
select locate('HE','hello',2);
|
||||
locate('HE','hello',2)
|
||||
0
|
||||
select locate('LO','hello',2);
|
||||
locate('LO','hello',2)
|
||||
4
|
||||
select locate('HE','hello' collate ujis_bin);
|
||||
locate('HE','hello' collate ujis_bin)
|
||||
0
|
||||
select locate('HE','hello' collate ujis_bin,2);
|
||||
locate('HE','hello' collate ujis_bin,2)
|
||||
0
|
||||
select locate('LO','hello' collate ujis_bin,2);
|
||||
locate('LO','hello' collate ujis_bin,2)
|
||||
0
|
||||
select locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3);
|
||||
locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3)
|
||||
2
|
||||
select 0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%');
|
||||
0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%')
|
||||
1
|
||||
select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%');
|
||||
_ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%')
|
||||
0
|
||||
select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin;
|
||||
_ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin
|
||||
0
|
||||
select 'a' like 'a';
|
||||
'a' like 'a'
|
||||
1
|
||||
select 'A' like 'a';
|
||||
'A' like 'a'
|
||||
1
|
||||
select 'A' like 'a' collate ujis_bin;
|
||||
'A' like 'a' collate ujis_bin
|
||||
0
|
||||
|
61
mysql-test/r/ctype_utf8.result
Normal file
61
mysql-test/r/ctype_utf8.result
Normal file
@ -0,0 +1,61 @@
|
||||
set names utf8;
|
||||
select left(_utf8 0xD0B0D0B1D0B2,1);
|
||||
left(_utf8 0xD0B0D0B1D0B2,1)
|
||||
а
|
||||
select right(_utf8 0xD0B0D0B2D0B2,1);
|
||||
right(_utf8 0xD0B0D0B2D0B2,1)
|
||||
в
|
||||
select locate('he','hello');
|
||||
locate('he','hello')
|
||||
1
|
||||
select locate('he','hello',2);
|
||||
locate('he','hello',2)
|
||||
0
|
||||
select locate('lo','hello',2);
|
||||
locate('lo','hello',2)
|
||||
4
|
||||
select locate('HE','hello');
|
||||
locate('HE','hello')
|
||||
1
|
||||
select locate('HE','hello',2);
|
||||
locate('HE','hello',2)
|
||||
0
|
||||
select locate('LO','hello',2);
|
||||
locate('LO','hello',2)
|
||||
4
|
||||
select locate('HE','hello' collate utf8_bin);
|
||||
locate('HE','hello' collate utf8_bin)
|
||||
0
|
||||
select locate('HE','hello' collate utf8_bin,2);
|
||||
locate('HE','hello' collate utf8_bin,2)
|
||||
0
|
||||
select locate('LO','hello' collate utf8_bin,2);
|
||||
locate('LO','hello' collate utf8_bin,2)
|
||||
0
|
||||
select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2);
|
||||
locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2)
|
||||
2
|
||||
select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2);
|
||||
locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2)
|
||||
2
|
||||
select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2);
|
||||
locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2)
|
||||
2
|
||||
select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin);
|
||||
locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin)
|
||||
0
|
||||
select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin);
|
||||
locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin)
|
||||
0
|
||||
select 'a' like 'a';
|
||||
'a' like 'a'
|
||||
1
|
||||
select 'A' like 'a';
|
||||
'A' like 'a'
|
||||
1
|
||||
select 'A' like 'a' collate utf8_bin;
|
||||
'A' like 'a' collate utf8_bin
|
||||
0
|
||||
select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%');
|
||||
_utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%')
|
||||
1
|
@ -196,3 +196,22 @@ drop table t1,t2;
|
||||
SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
|
||||
x
|
||||
1
|
||||
create table t1 select 1 as a;
|
||||
select 2 as a from (select * from t1) b;
|
||||
ERROR 3D000: No Database Selected
|
||||
use test;
|
||||
select 2 as a from (select * from t1) b;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id;
|
||||
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 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
update (select * from t1) as t1 set a = 5;
|
||||
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
|
||||
delete from (select * from t1);
|
||||
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 '(select * from t1)' at line 1
|
||||
insert into (select * from t1) values (5);
|
||||
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 '(select * from t1) values (5)' at line 1
|
||||
drop table t1;
|
||||
|
@ -427,3 +427,40 @@ name
|
||||
a
|
||||
e
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(75) DEFAULT '' NOT NULL,
|
||||
LINK_ID int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME),
|
||||
KEY LINK_ID (LINK_ID)
|
||||
);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
|
||||
CREATE TABLE t2 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(150) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME)
|
||||
);
|
||||
SELECT DISTINCT
|
||||
t2.id AS key_link_id,
|
||||
t2.name AS link
|
||||
FROM t1
|
||||
LEFT JOIN t2 ON t1.link_id=t2.id
|
||||
GROUP BY t1.id
|
||||
ORDER BY link;
|
||||
key_link_id link
|
||||
NULL NULL
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
html varchar(5) default NULL,
|
||||
rin int(11) default '0',
|
||||
out int(11) default '0'
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('1',1,0);
|
||||
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
html prod
|
||||
1 0.00
|
||||
drop table t1;
|
||||
|
@ -44,3 +44,13 @@ mysql
|
||||
test
|
||||
drop database mysqltest;
|
||||
ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist
|
||||
drop table t1;
|
||||
flush tables with read lock;
|
||||
create table t1(n int);
|
||||
ERROR HY000: Can't execute the query because you have a conflicting read lock
|
||||
unlock tables;
|
||||
create table t1(n int);
|
||||
show tables;
|
||||
Tables_in_test
|
||||
t1
|
||||
drop table t1;
|
||||
|
@ -40,3 +40,9 @@ uncompress(compress(""))
|
||||
select uncompressed_length("");
|
||||
uncompressed_length("")
|
||||
0
|
||||
select compress(NULL);
|
||||
compress(NULL)
|
||||
NULL
|
||||
select uncompress(NULL);
|
||||
uncompress(NULL)
|
||||
NULL
|
||||
|
@ -1,15 +1,79 @@
|
||||
select length(encrypt('foo', 'ff')) <> 0;
|
||||
length(encrypt('foo', 'ff')) <> 0
|
||||
1
|
||||
select password("a",""), password("a",NULL), password("","a"), password(NULL,"a");
|
||||
password("a","") password("a",NULL) password("","a") password(NULL,"a")
|
||||
*2517f7235d68d4ba2e5019c93420523101157a792c01 NULL NULL
|
||||
select password("aaaaaaaaaaaaaaaa","a"), password("a","aaaaaaaaaaaaaaaa");
|
||||
password("aaaaaaaaaaaaaaaa","a") password("a","aaaaaaaaaaaaaaaa")
|
||||
*2cd3b9a44e9a9994789a30f935c92f45a96c5472f381 *37c7c5c794ff144819f2531bf03c57772cd84e40db09
|
||||
select old_password('test'), length(password("1")), length(encrypt('test')), encrypt('test','aa');
|
||||
old_password('test') length(password("1")) length(encrypt('test')) encrypt('test','aa')
|
||||
378b243e220ca493 45 13 aaqPiZY5xR5l.
|
||||
select old_password(""), old_password(NULL), password(""), password(NULL);
|
||||
old_password("") old_password(NULL) password("") password(NULL)
|
||||
NULL NULL
|
||||
select password('abc');
|
||||
password('abc')
|
||||
*0D3CED9BEC10A777AEC23CCC353A8C08A633045E
|
||||
select password('');
|
||||
password('')
|
||||
|
||||
select old_password('abc');
|
||||
old_password('abc')
|
||||
7cd2b5942be28759
|
||||
select old_password('');
|
||||
old_password('')
|
||||
|
||||
select password('gabbagabbahey');
|
||||
password('gabbagabbahey')
|
||||
*B0F99D2963660DD7E16B751EC9EE2F17B6A68FA6
|
||||
select old_password('idkfa');
|
||||
old_password('idkfa')
|
||||
5c078dc54ca0fcca
|
||||
select length(password('1'));
|
||||
length(password('1'))
|
||||
41
|
||||
select length(encrypt('test'));
|
||||
length(encrypt('test'))
|
||||
13
|
||||
select encrypt('test','aa');
|
||||
encrypt('test','aa')
|
||||
aaqPiZY5xR5l.
|
||||
select old_password(NULL);
|
||||
old_password(NULL)
|
||||
NULL
|
||||
select password(NULL);
|
||||
password(NULL)
|
||||
NULL
|
||||
set global old_passwords=on;
|
||||
select password('');
|
||||
password('')
|
||||
|
||||
select old_password('');
|
||||
old_password('')
|
||||
|
||||
select password('idkfa');
|
||||
password('idkfa')
|
||||
*B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA
|
||||
select old_password('idkfa');
|
||||
old_password('idkfa')
|
||||
5c078dc54ca0fcca
|
||||
set old_passwords=on;
|
||||
select password('idkfa');
|
||||
password('idkfa')
|
||||
5c078dc54ca0fcca
|
||||
select old_password('idkfa');
|
||||
old_password('idkfa')
|
||||
5c078dc54ca0fcca
|
||||
set global old_passwords=off;
|
||||
select password('idkfa');
|
||||
password('idkfa')
|
||||
5c078dc54ca0fcca
|
||||
select old_password('idkfa');
|
||||
old_password('idkfa')
|
||||
5c078dc54ca0fcca
|
||||
set old_passwords=off;
|
||||
select password('idkfa ');
|
||||
password('idkfa ')
|
||||
*2DC31D90647B4C1ABC9231563D2236E96C9A2DB2
|
||||
select password('idkfa');
|
||||
password('idkfa')
|
||||
*B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA
|
||||
select password(' idkfa');
|
||||
password(' idkfa')
|
||||
*12B099E56BB7FE8D43C78FD834A9D1D11178D045
|
||||
select old_password('idkfa');
|
||||
old_password('idkfa')
|
||||
5c078dc54ca0fcca
|
||||
select old_password(' i d k f a ');
|
||||
old_password(' i d k f a ')
|
||||
5c078dc54ca0fcca
|
||||
|
@ -167,6 +167,11 @@ t2.URL_ID = t1.URL_ID group by REQ_ID;
|
||||
REQ_ID URL
|
||||
1 X
|
||||
5 X,X,X
|
||||
select REQ_ID, Group_Concat(URL) as URL, Min(t1.URL_ID) urll,
|
||||
Max(t1.URL_ID)
|
||||
urlg from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID;
|
||||
REQ_ID URL urll urlg
|
||||
1 X 4 4
|
||||
5 X,X,X 4 5
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
@ -178,3 +183,16 @@ select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') a
|
||||
select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1;
|
||||
with distinct: cutoff at length of shortname
|
||||
1:longername,1:evenlongername
|
||||
drop table t1;
|
||||
create table t1(id int);
|
||||
create table t2(id int);
|
||||
insert into t1 values(0),(1);
|
||||
select group_concat(t1.id) FROM t1,t2;
|
||||
group_concat(t1.id)
|
||||
NULL
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
create table t1 (bar varchar(32));
|
||||
insert into t1 values('test'),('test2');
|
||||
select * from t1 having group_concat(bar)='';
|
||||
bar
|
||||
|
@ -551,7 +551,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
explain
|
||||
select min(a1) from t1 where a1 between a3 and 'KKK';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 14 Using where
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 14 Using where
|
||||
explain
|
||||
select min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
|
@ -52,3 +52,27 @@ select * from t1 where xxx REGEXP '^this is some text: to test - out\\.reg exp [
|
||||
xxx
|
||||
this is some text: to test - out.reg exp (22/45)
|
||||
drop table t1;
|
||||
select _latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin;
|
||||
_latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin
|
||||
1
|
||||
select _koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin;
|
||||
_koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin
|
||||
0
|
||||
select _latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin;
|
||||
_latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin
|
||||
0
|
||||
select _koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin;
|
||||
_koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin
|
||||
1
|
||||
select _latin1 0xF7 regexp _latin1 '[[:alpha:]]';
|
||||
_latin1 0xF7 regexp _latin1 '[[:alpha:]]'
|
||||
0
|
||||
select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]';
|
||||
_koi8r 0xF7 regexp _koi8r '[[:alpha:]]'
|
||||
1
|
||||
select _latin1'a' regexp _latin1'A' collate latin1_general_ci;
|
||||
_latin1'a' regexp _latin1'A' collate latin1_general_ci
|
||||
1
|
||||
select _latin1'a' regexp _latin1'A' collate latin1_bin;
|
||||
_latin1'a' regexp _latin1'A' collate latin1_bin
|
||||
0
|
||||
|
@ -410,7 +410,7 @@ collation(concat(_latin2'a',_latin2'b')) coercibility(concat(_latin2'a',_latin2'
|
||||
latin2_general_ci 3
|
||||
select collation(lpad(_latin2'a',4,_latin2'b')), coercibility(lpad(_latin2'a',4,_latin2'b'));
|
||||
collation(lpad(_latin2'a',4,_latin2'b')) coercibility(lpad(_latin2'a',4,_latin2'b'))
|
||||
binary 3
|
||||
latin2_general_ci 3
|
||||
select collation(rpad(_latin2'a',4,_latin2'b')), coercibility(rpad(_latin2'a',4,_latin2'b'));
|
||||
collation(rpad(_latin2'a',4,_latin2'b')) coercibility(rpad(_latin2'a',4,_latin2'b'))
|
||||
latin2_general_ci 3
|
||||
|
@ -1,3 +1,4 @@
|
||||
drop table if exists t1,t2;
|
||||
select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ;
|
||||
0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a")
|
||||
1 1 1 0 0 1 -1 1 0
|
||||
@ -123,3 +124,11 @@ select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin;
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like'
|
||||
select _koi8r'a' LIKE _latin1'A';
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like'
|
||||
CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','<as-html>\r\n<table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"><3E></td>\r\n <td width=\"97%\">\r\n <h3><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000000\">How \r\n To</font><!-- #BeginEditable \"CS_troubleshoot_question\" --><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000099\"><font color=\"#000000\">: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected. </font></font><!-- #EndEditable --></h3>\r\n </td>\r\n </tr>\r\n</table>','<as-html>\r\n <table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"><3E></td>\r\n \r\n<td width=\"97%\"><!-- #BeginEditable \"CS_troubleshoot_answer\" --> \r\n \r\n<p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">1. Select \r\n the <i>On/Setup</i> button to access the DynaVox Setup Menu.<br>\r\n 2. Select <b>Button Features.</b><br>\r\n 3. Below the <b>OK</b> button is the <b>Usage Counts</b> button.<br>\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.<br>\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.<br>\r\n c. Select the <b>Usage Counts</b> Option Ring once and it will toggle \r\n to the alternative option.<br>\r\n 4. Once the correct setting has been chosen, select <b>OK</b> to leave the <i>Button \r\n Features</i> menu.<br>\r\n 5. Select <b>OK</b> out of the <i>Setup</i> menu and return to the communication \r\n page.</font></p>\r\n <p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">For \r\n further information on <i>Usage Counts,</i> see the <i>Button Features \r\n Menu Entry</i> in the DynaVox/DynaMyte Reference Manual.</font></p>\r\n<!-- #EndEditable --></td>\r\n </tr>\r\n</table>',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL);
|
||||
CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) TYPE=MyISAM;
|
||||
INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1);
|
||||
SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank;
|
||||
rank rank rank
|
||||
2 2 NULL
|
||||
DROP TABLE t1,t2;
|
||||
|
@ -91,19 +91,39 @@ show grants for mysqltest_1@localhost;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||
GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
|
||||
REVOKE insert,insert (a) on t1 from mysqltest_1@localhost;
|
||||
GRANT references on t1 to mysqltest_1@localhost;
|
||||
REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost;
|
||||
show grants for mysqltest_1@localhost;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||
GRANT SELECT, REFERENCES, REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
|
||||
GRANT REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
|
||||
GRANT select,references on t1 to mysqltest_1@localhost;
|
||||
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
|
||||
table_priv column_priv
|
||||
Select,References References
|
||||
delete from mysql.user where user='mysqltest_1';
|
||||
delete from mysql.db where user='mysqltest_1';
|
||||
delete from mysql.tables_priv where user='mysqltest_1';
|
||||
delete from mysql.columns_priv where user='mysqltest_1';
|
||||
grant all on test.* to mysqltest_3@localhost with grant option;
|
||||
revoke all on test.* from mysqltest_3@localhost;
|
||||
show grants for mysqltest_3@localhost;
|
||||
Grants for mysqltest_3@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
|
||||
GRANT USAGE ON `test`.* TO 'mysqltest_3'@'localhost' WITH GRANT OPTION
|
||||
revoke grant option on test.* from mysqltest_3@localhost;
|
||||
show grants for mysqltest_3@localhost;
|
||||
Grants for mysqltest_3@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
|
||||
grant all on test.t1 to mysqltest_2@localhost with grant option;
|
||||
revoke all on test.t1 from mysqltest_2@localhost;
|
||||
show grants for mysqltest_2@localhost;
|
||||
Grants for mysqltest_2@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
|
||||
GRANT USAGE ON `test`.`t1` TO 'mysqltest_2'@'localhost' WITH GRANT OPTION
|
||||
revoke grant option on test.t1 from mysqltest_2@localhost;
|
||||
show grants for mysqltest_2@localhost;
|
||||
Grants for mysqltest_2@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
|
||||
delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
|
||||
delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
|
||||
delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
|
||||
delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
|
||||
flush privileges;
|
||||
drop table t1;
|
||||
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
|
||||
|
@ -586,4 +586,15 @@ select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(q
|
||||
id sqty cqty
|
||||
1 5 2
|
||||
2 9 2
|
||||
select count(*), case interval(qty,2,3,4,5,6,7,8) when -1 then NULL when 0 then "zero" when 1 then "one" when 2 then "two" end as category from t1 group by category;
|
||||
count(*) category
|
||||
2 NULL
|
||||
1 one
|
||||
1 two
|
||||
select count(*), interval(qty,2,3,4,5,6,7,8) as category from t1 group by category;
|
||||
count(*) category
|
||||
1 1
|
||||
1 2
|
||||
1 3
|
||||
1 4
|
||||
drop table t1;
|
||||
|
@ -1,2 +0,0 @@
|
||||
Variable_name Value
|
||||
Ssl_cipher EDH-RSA-DES-CBC3-SHA
|
@ -1,2 +1,2 @@
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
ujis_japanese_ci ujis 12 Yes Yes 0
|
||||
ujis_japanese_ci ujis 12 Yes Yes 1
|
||||
|
@ -251,6 +251,18 @@ n
|
||||
6
|
||||
rollback;
|
||||
drop table t1;
|
||||
create table t1 (n int not null primary key) type=innodb;
|
||||
start transaction;
|
||||
insert into t1 values (4);
|
||||
flush tables with read lock;
|
||||
commit;
|
||||
ERROR HY000: Can't execute the query because you have a conflicting read lock
|
||||
unlock tables;
|
||||
commit;
|
||||
select * from t1;
|
||||
n
|
||||
4
|
||||
drop table t1;
|
||||
create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) type=innodb;
|
||||
begin;
|
||||
insert into t1 values(1,'hamdouni');
|
||||
@ -1342,3 +1354,40 @@ id label
|
||||
3524 Societe Test
|
||||
3525 Fournisseur Test
|
||||
drop table t1,t2;
|
||||
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) type=innodb;
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12");
|
||||
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" );
|
||||
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
drop table t1;
|
||||
create table t1 (a int, b varchar(200), c text not null) checksum=1 type=myisam;
|
||||
create table t2 (a int, b varchar(200), c text not null) checksum=0 type=innodb;
|
||||
create table t3 (a int, b varchar(200), c text not null) checksum=1 type=innodb;
|
||||
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
|
||||
insert t2 select * from t1;
|
||||
insert t3 select * from t1;
|
||||
checksum table t1, t2, t3, t4 quick;
|
||||
Table Checksum
|
||||
test.t1 968604391
|
||||
test.t2 NULL
|
||||
test.t3 NULL
|
||||
test.t4 NULL
|
||||
checksum table t1, t2, t3, t4;
|
||||
Table Checksum
|
||||
test.t1 968604391
|
||||
test.t2 968604391
|
||||
test.t3 968604391
|
||||
test.t4 NULL
|
||||
checksum table t1, t2, t3, t4 extended;
|
||||
Table Checksum
|
||||
test.t1 968604391
|
||||
test.t2 968604391
|
||||
test.t3 968604391
|
||||
test.t4 NULL
|
||||
drop table t1,t2,t3;
|
||||
|
@ -10,7 +10,7 @@ a
|
||||
3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1;
|
||||
commit;
|
||||
set autocommit=1;
|
||||
@ -24,7 +24,7 @@ a
|
||||
3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1;
|
||||
commit;
|
||||
create table t1 (a int not null) type=innodb;
|
||||
@ -90,14 +90,14 @@ a
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
Qcache_queries_in_cache 1
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 4
|
||||
commit;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
Qcache_queries_in_cache 1
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=InnoDB;
|
||||
select count(*) from t1;
|
||||
|
@ -1,13 +1,5 @@
|
||||
drop table if exists t1,t2;
|
||||
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) type=isam;
|
||||
Warnings:
|
||||
Warning 1263 Data truncated for column 'b' at row 1
|
||||
Warnings:
|
||||
Warning 1263 Data truncated for column 'b' at row 1
|
||||
Warnings:
|
||||
Warning 1263 Data truncated for column 'b' at row 1
|
||||
Warnings:
|
||||
Warning 1263 Data truncated for column 'b' at row 1
|
||||
delete from t1 where (a & 1);
|
||||
select sum(length(b)) from t1;
|
||||
sum(length(b))
|
||||
@ -87,3 +79,173 @@ t1 0 PRIMARY 1 a A 4 NULL NULL BTREE
|
||||
t1 1 b 1 b A 1 NULL NULL BTREE
|
||||
t1 1 b 2 c A 4 NULL NULL BTREE
|
||||
drop table t1,t2;
|
||||
create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
|
||||
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
||||
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
|
||||
int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int,
|
||||
i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51
|
||||
int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int,
|
||||
i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68
|
||||
int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int,
|
||||
i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85
|
||||
int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int,
|
||||
i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102
|
||||
int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110
|
||||
int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118
|
||||
int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126
|
||||
int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134
|
||||
int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142
|
||||
int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150
|
||||
int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158
|
||||
int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166
|
||||
int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174
|
||||
int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182
|
||||
int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190
|
||||
int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198
|
||||
int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206
|
||||
int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214
|
||||
int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222
|
||||
int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230
|
||||
int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238
|
||||
int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246
|
||||
int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254
|
||||
int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262
|
||||
int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270
|
||||
int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278
|
||||
int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286
|
||||
int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294
|
||||
int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302
|
||||
int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310
|
||||
int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318
|
||||
int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326
|
||||
int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334
|
||||
int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342
|
||||
int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350
|
||||
int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358
|
||||
int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366
|
||||
int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374
|
||||
int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382
|
||||
int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390
|
||||
int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398
|
||||
int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406
|
||||
int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414
|
||||
int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422
|
||||
int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430
|
||||
int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438
|
||||
int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446
|
||||
int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454
|
||||
int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462
|
||||
int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470
|
||||
int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478
|
||||
int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486
|
||||
int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494
|
||||
int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502
|
||||
int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510
|
||||
int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518
|
||||
int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526
|
||||
int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534
|
||||
int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542
|
||||
int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550
|
||||
int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558
|
||||
int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566
|
||||
int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574
|
||||
int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582
|
||||
int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590
|
||||
int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598
|
||||
int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606
|
||||
int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614
|
||||
int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622
|
||||
int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630
|
||||
int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638
|
||||
int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646
|
||||
int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654
|
||||
int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662
|
||||
int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670
|
||||
int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678
|
||||
int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686
|
||||
int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694
|
||||
int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702
|
||||
int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710
|
||||
int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718
|
||||
int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726
|
||||
int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734
|
||||
int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742
|
||||
int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750
|
||||
int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758
|
||||
int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766
|
||||
int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774
|
||||
int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782
|
||||
int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790
|
||||
int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798
|
||||
int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806
|
||||
int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814
|
||||
int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822
|
||||
int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830
|
||||
int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838
|
||||
int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846
|
||||
int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854
|
||||
int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862
|
||||
int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870
|
||||
int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878
|
||||
int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886
|
||||
int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894
|
||||
int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902
|
||||
int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910
|
||||
int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918
|
||||
int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926
|
||||
int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934
|
||||
int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942
|
||||
int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950
|
||||
int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958
|
||||
int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966
|
||||
int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
||||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob) row_format=dynamic;
|
||||
insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei");
|
||||
update t1 set b=repeat('a',256);
|
||||
update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
|
@ -28,3 +28,15 @@ NULL NULL 0000-00-00 0000-00-00
|
||||
NULL 0000-00-00 0000-00-00 0000-00-00
|
||||
NULL 2003-03-03 2003-03-03 NULL
|
||||
drop table t1;
|
||||
create table t1 (a text, b text);
|
||||
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
|
||||
Warnings:
|
||||
Warning 1260 Record count is fewer than the column count at row 3
|
||||
select concat('|',a,'|'), concat('|',b,'|') from t1;
|
||||
concat('|',a,'|') concat('|',b,'|')
|
||||
|Field A| |Field B|
|
||||
|Field 1| |Field 2'
|
||||
Field 3,'Field 4|
|
||||
|Field 5' ,'Field 6| NULL
|
||||
|Field 6| | 'Field 7'|
|
||||
drop table t1;
|
||||
|
@ -6,6 +6,15 @@ id Word
|
||||
1 a
|
||||
2 b
|
||||
3 c
|
||||
SELECT T1.id from T1 LIMIT 1;
|
||||
id
|
||||
1
|
||||
SELECT T2.id from t1 as T2 LIMIT 1;
|
||||
id
|
||||
1
|
||||
SELECT T2.id from t1 as t2 LIMIT 1;
|
||||
id
|
||||
1
|
||||
RENAME TABLE T1 TO T2;
|
||||
ALTER TABLE T2 ADD new_col int not null;
|
||||
ALTER TABLE T2 RENAME T3;
|
||||
|
183
mysql-test/r/mix_innodb_myisam_binlog.result
Normal file
183
mysql-test/r/mix_innodb_myisam_binlog.result
Normal file
@ -0,0 +1,183 @@
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (a int) type=innodb;
|
||||
create table t2 (a int) type=myisam;
|
||||
reset master;
|
||||
begin;
|
||||
insert into t1 values(1);
|
||||
insert into t2 select * from t1;
|
||||
commit;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; BEGIN
|
||||
master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(1)
|
||||
master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 244 Query 1 244 use `test`; COMMIT
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
begin;
|
||||
insert into t1 values(2);
|
||||
insert into t2 select * from t1;
|
||||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; BEGIN
|
||||
master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(2)
|
||||
master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 244 Query 1 244 use `test`; ROLLBACK
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
begin;
|
||||
insert into t1 values(3);
|
||||
savepoint my_savepoint;
|
||||
insert into t1 values(4);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
commit;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; BEGIN
|
||||
master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(3)
|
||||
master-bin.000001 178 Query 1 79 use `test`; savepoint my_savepoint
|
||||
master-bin.000001 235 Query 1 79 use `test`; insert into t1 values(4)
|
||||
master-bin.000001 294 Query 1 79 use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 429 Query 1 429 use `test`; COMMIT
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
begin;
|
||||
insert into t1 values(5);
|
||||
savepoint my_savepoint;
|
||||
insert into t1 values(6);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
insert into t1 values(7);
|
||||
commit;
|
||||
select a from t1 order by a;
|
||||
a
|
||||
5
|
||||
7
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; BEGIN
|
||||
master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(5)
|
||||
master-bin.000001 178 Query 1 79 use `test`; savepoint my_savepoint
|
||||
master-bin.000001 235 Query 1 79 use `test`; insert into t1 values(6)
|
||||
master-bin.000001 294 Query 1 79 use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 429 Query 1 79 use `test`; insert into t1 values(7)
|
||||
master-bin.000001 488 Query 1 488 use `test`; COMMIT
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
select get_lock("a",10);
|
||||
get_lock("a",10)
|
||||
1
|
||||
begin;
|
||||
insert into t1 values(8);
|
||||
insert into t2 select * from t1;
|
||||
select get_lock("a",10);
|
||||
get_lock("a",10)
|
||||
1
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; BEGIN
|
||||
master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(8)
|
||||
master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 244 Query 1 244 use `test`; ROLLBACK
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
insert into t1 values(9);
|
||||
insert into t2 select * from t1;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(9)
|
||||
master-bin.000001 138 Query 1 138 use `test`; insert into t2 select * from t1
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
insert into t1 values(10);
|
||||
begin;
|
||||
insert into t2 select * from t1;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(10)
|
||||
master-bin.000001 139 Query 1 139 use `test`; insert into t2 select * from t1
|
||||
insert into t1 values(11);
|
||||
commit;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(10)
|
||||
master-bin.000001 139 Query 1 139 use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 205 Query 1 205 use `test`; BEGIN
|
||||
master-bin.000001 245 Query 1 205 use `test`; insert into t1 values(11)
|
||||
master-bin.000001 305 Query 1 305 use `test`; COMMIT
|
||||
alter table t2 type=INNODB;
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
begin;
|
||||
insert into t1 values(12);
|
||||
insert into t2 select * from t1;
|
||||
commit;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; BEGIN
|
||||
master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(12)
|
||||
master-bin.000001 179 Query 1 79 use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 245 Query 1 245 use `test`; COMMIT
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
begin;
|
||||
insert into t1 values(13);
|
||||
insert into t2 select * from t1;
|
||||
rollback;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
begin;
|
||||
insert into t1 values(14);
|
||||
savepoint my_savepoint;
|
||||
insert into t1 values(15);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
commit;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; BEGIN
|
||||
master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(14)
|
||||
master-bin.000001 179 Query 1 179 use `test`; COMMIT
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
begin;
|
||||
insert into t1 values(16);
|
||||
savepoint my_savepoint;
|
||||
insert into t1 values(17);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
insert into t1 values(18);
|
||||
commit;
|
||||
select a from t1 order by a;
|
||||
a
|
||||
16
|
||||
18
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; BEGIN
|
||||
master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(16)
|
||||
master-bin.000001 179 Query 1 79 use `test`; insert into t1 values(18)
|
||||
master-bin.000001 239 Query 1 239 use `test`; COMMIT
|
||||
drop table t1,t2;
|
@ -332,3 +332,12 @@ create table t2(Z varchar(15));
|
||||
insert into t2(Z) select concat(a.a,b.a,c.a,d.a) from t1 as a, t1 as b, t1 as c, t1 as d;
|
||||
update t2,t3 set Z =param_scenario_costs;
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (a int, b int);
|
||||
create table t2 (a int, b int);
|
||||
insert into t1 values (1,1),(2,1),(3,1);
|
||||
insert into t2 values (1,1), (3,1);
|
||||
update t1 left join t2 on t1.a=t2.a set t1.b=2, t2.b=2 where t1.b=1 and t2.b=1 or t2.a is NULL;
|
||||
select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL;
|
||||
a b a b
|
||||
2 2 NULL NULL
|
||||
drop table t1,t2;
|
||||
|
@ -285,6 +285,17 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei");
|
||||
update t1 set b=repeat('a',256);
|
||||
update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
delete from t1 where i8=1;
|
||||
select i1,i2 from t1;
|
||||
i1 i2
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
CREATE TABLE `t1` (
|
||||
`post_id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
@ -365,8 +376,47 @@ explain select * from t1 use index() where c=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
|
||||
drop table t1,t2;
|
||||
create table t1 (a int not null auto_increment primary key, b varchar(255));
|
||||
insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100));
|
||||
update t1 set b=repeat(left(b,1),200) where a=1;
|
||||
delete from t1 where (a & 1)= 0;
|
||||
update t1 set b=repeat('e',200) where a=1;
|
||||
flush tables;
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
update t1 set b=repeat(left(b,1),255) where a between 1 and 5;
|
||||
update t1 set b=repeat(left(b,1),10) where a between 32 and 43;
|
||||
update t1 set b=repeat(left(b,1),2) where a between 64 and 66;
|
||||
update t1 set b=repeat(left(b,1),65) where a between 67 and 70;
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
insert into t1 (b) values (repeat('z',100));
|
||||
update t1 set b="test" where left(b,1) > 'n';
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) TYPE=MyISAM;
|
||||
ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
create table t1 (a int, b varchar(200), c text not null) checksum=1;
|
||||
create table t2 (a int, b varchar(200), c text not null) checksum=0;
|
||||
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
|
||||
insert t2 select * from t1;
|
||||
checksum table t1, t2, t3 quick;
|
||||
Table Checksum
|
||||
test.t1 968604391
|
||||
test.t2 NULL
|
||||
test.t3 NULL
|
||||
checksum table t1, t2, t3;
|
||||
Table Checksum
|
||||
test.t1 968604391
|
||||
test.t2 968604391
|
||||
test.t3 NULL
|
||||
checksum table t1, t2, t3 extended;
|
||||
Table Checksum
|
||||
test.t1 968604391
|
||||
test.t2 968604391
|
||||
test.t3 NULL
|
||||
drop table t1,t2;
|
||||
|
20
mysql-test/r/mysqldump.result
Normal file
20
mysql-test/r/mysqldump.result
Normal file
@ -0,0 +1,20 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
<?xml version="1.0"?>
|
||||
<mysqldump>
|
||||
<database name="test">
|
||||
DROP TABLE IF EXISTS t1;
|
||||
LOCK TABLES t1 WRITE;
|
||||
<table name="t1">
|
||||
<row>
|
||||
<field name="a">1</field>
|
||||
</row>
|
||||
<row>
|
||||
<field name="a">2</field>
|
||||
</row>
|
||||
</table>
|
||||
UNLOCK TABLES;
|
||||
</database>
|
||||
</mysqldump>
|
||||
DROP TABLE t1;
|
@ -254,3 +254,18 @@ ERROR 42000: This version of MySQL doesn't yet support 'CUBE'
|
||||
select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube union all select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup;
|
||||
ERROR 42000: This version of MySQL doesn't yet support 'CUBE'
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (i int);
|
||||
INSERT INTO t1 VALUES(100);
|
||||
CREATE TABLE t2 (i int);
|
||||
INSERT INTO t2 VALUES (100),(200);
|
||||
SELECT i, COUNT(*) FROM t1 GROUP BY i WITH ROLLUP;
|
||||
i COUNT(*)
|
||||
100 1
|
||||
NULL 1
|
||||
SELECT t1.i, t2.i, COUNT(*) FROM t1,t2 GROUP BY t1.i,t2.i WITH ROLLUP;
|
||||
i i COUNT(*)
|
||||
100 100 1
|
||||
100 200 1
|
||||
100 NULL 2
|
||||
NULL NULL 2
|
||||
drop table t1,t2;
|
||||
|
@ -3,29 +3,29 @@ create table t1(f1 int);
|
||||
insert into t1 values (5);
|
||||
grant select on test.* to ssl_user1@localhost require SSL;
|
||||
grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
|
||||
grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com";
|
||||
grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com";
|
||||
grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com";
|
||||
grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com";
|
||||
flush privileges;
|
||||
select * from t1;
|
||||
f1
|
||||
5
|
||||
delete from t1;
|
||||
ERROR 42000: Access denied for user: 'ssl_user1@localhost' to database 'test'
|
||||
ERROR 42000: Access denied for user: 'ssl_user1'@'localhost' to database 'test'
|
||||
select * from t1;
|
||||
f1
|
||||
5
|
||||
delete from t1;
|
||||
ERROR 42000: Access denied for user: 'ssl_user2@localhost' to database 'test'
|
||||
ERROR 42000: Access denied for user: 'ssl_user2'@'localhost' to database 'test'
|
||||
select * from t1;
|
||||
f1
|
||||
5
|
||||
delete from t1;
|
||||
ERROR 42000: Access denied for user: 'ssl_user3@localhost' to database 'test'
|
||||
ERROR 42000: Access denied for user: 'ssl_user3'@'localhost' to database 'test'
|
||||
select * from t1;
|
||||
f1
|
||||
5
|
||||
delete from t1;
|
||||
ERROR 42000: Access denied for user: 'ssl_user4@localhost' to database 'test'
|
||||
ERROR 42000: Access denied for user: 'ssl_user4'@'localhost' to database 'test'
|
||||
delete from mysql.user where user='ssl_user%';
|
||||
delete from mysql.db where user='ssl_user%';
|
||||
flush privileges;
|
||||
|
@ -5,12 +5,12 @@ set net_buffer_length=100;
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
len
|
||||
1024
|
||||
select repeat('a',200);
|
||||
repeat('a',200)
|
||||
select repeat('a',2000);
|
||||
repeat('a',2000)
|
||||
NULL
|
||||
select @@net_buffer_length, @@max_allowed_packet;
|
||||
@@net_buffer_length @@max_allowed_packet
|
||||
1024 80
|
||||
1024 1024
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
ERROR 08S01: Got a packet bigger than 'max_allowed_packet'
|
||||
set global max_allowed_packet=default;
|
||||
@ -20,6 +20,6 @@ set net_buffer_length=default;
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
len
|
||||
100
|
||||
select length(repeat('a',200));
|
||||
length(repeat('a',200))
|
||||
200
|
||||
select length(repeat('a',2000));
|
||||
length(repeat('a',2000))
|
||||
2000
|
||||
|
@ -2,7 +2,7 @@ flush query cache;
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush status;
|
||||
drop table if exists t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t00,mysqltest.t1;
|
||||
drop table if exists t1,t2,t3;
|
||||
drop database if exists mysqltest;
|
||||
create table t1 (a int not null);
|
||||
insert into t1 values (1),(2),(3);
|
||||
@ -709,536 +709,3 @@ Variable_name Value
|
||||
Qcache_queries_in_cache 2
|
||||
SET OPTION SQL_SELECT_LIMIT=DEFAULT;
|
||||
drop table t1;
|
||||
flush status;
|
||||
create table t0(a int);
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
create table t3(a int);
|
||||
create table t4(a int);
|
||||
create table t5(a int);
|
||||
create table t6(a int);
|
||||
create table t7(a int);
|
||||
create table t8(a int);
|
||||
create table t9(a int);
|
||||
create table t10(a int);
|
||||
create table t11(a int);
|
||||
create table t12(a int);
|
||||
create table t13(a int);
|
||||
create table t14(a int);
|
||||
create table t15(a int);
|
||||
create table t16(a int);
|
||||
create table t17(a int);
|
||||
create table t18(a int);
|
||||
create table t19(a int);
|
||||
create table t20(a int);
|
||||
create table t21(a int);
|
||||
create table t22(a int);
|
||||
create table t23(a int);
|
||||
create table t24(a int);
|
||||
create table t25(a int);
|
||||
create table t26(a int);
|
||||
create table t27(a int);
|
||||
create table t28(a int);
|
||||
create table t29(a int);
|
||||
create table t30(a int);
|
||||
create table t31(a int);
|
||||
create table t32(a int);
|
||||
create table t33(a int);
|
||||
create table t34(a int);
|
||||
create table t35(a int);
|
||||
create table t36(a int);
|
||||
create table t37(a int);
|
||||
create table t38(a int);
|
||||
create table t39(a int);
|
||||
create table t40(a int);
|
||||
create table t41(a int);
|
||||
create table t42(a int);
|
||||
create table t43(a int);
|
||||
create table t44(a int);
|
||||
create table t45(a int);
|
||||
create table t46(a int);
|
||||
create table t47(a int);
|
||||
create table t48(a int);
|
||||
create table t49(a int);
|
||||
create table t50(a int);
|
||||
create table t51(a int);
|
||||
create table t52(a int);
|
||||
create table t53(a int);
|
||||
create table t54(a int);
|
||||
create table t55(a int);
|
||||
create table t56(a int);
|
||||
create table t57(a int);
|
||||
create table t58(a int);
|
||||
create table t59(a int);
|
||||
create table t60(a int);
|
||||
create table t61(a int);
|
||||
create table t62(a int);
|
||||
create table t63(a int);
|
||||
create table t64(a int);
|
||||
create table t65(a int);
|
||||
create table t66(a int);
|
||||
create table t67(a int);
|
||||
create table t68(a int);
|
||||
create table t69(a int);
|
||||
create table t70(a int);
|
||||
create table t71(a int);
|
||||
create table t72(a int);
|
||||
create table t73(a int);
|
||||
create table t74(a int);
|
||||
create table t75(a int);
|
||||
create table t76(a int);
|
||||
create table t77(a int);
|
||||
create table t78(a int);
|
||||
create table t79(a int);
|
||||
create table t80(a int);
|
||||
create table t81(a int);
|
||||
create table t82(a int);
|
||||
create table t83(a int);
|
||||
create table t84(a int);
|
||||
create table t85(a int);
|
||||
create table t86(a int);
|
||||
create table t87(a int);
|
||||
create table t88(a int);
|
||||
create table t89(a int);
|
||||
create table t90(a int);
|
||||
create table t91(a int);
|
||||
create table t92(a int);
|
||||
create table t93(a int);
|
||||
create table t94(a int);
|
||||
create table t95(a int);
|
||||
create table t96(a int);
|
||||
create table t97(a int);
|
||||
create table t98(a int);
|
||||
create table t99(a int);
|
||||
create table t100(a int);
|
||||
create table t101(a int);
|
||||
create table t102(a int);
|
||||
create table t103(a int);
|
||||
create table t104(a int);
|
||||
create table t105(a int);
|
||||
create table t106(a int);
|
||||
create table t107(a int);
|
||||
create table t108(a int);
|
||||
create table t109(a int);
|
||||
create table t110(a int);
|
||||
create table t111(a int);
|
||||
create table t112(a int);
|
||||
create table t113(a int);
|
||||
create table t114(a int);
|
||||
create table t115(a int);
|
||||
create table t116(a int);
|
||||
create table t117(a int);
|
||||
create table t118(a int);
|
||||
create table t119(a int);
|
||||
create table t120(a int);
|
||||
create table t121(a int);
|
||||
create table t122(a int);
|
||||
create table t123(a int);
|
||||
create table t124(a int);
|
||||
create table t125(a int);
|
||||
create table t126(a int);
|
||||
create table t127(a int);
|
||||
create table t128(a int);
|
||||
create table t129(a int);
|
||||
create table t130(a int);
|
||||
create table t131(a int);
|
||||
create table t132(a int);
|
||||
create table t133(a int);
|
||||
create table t134(a int);
|
||||
create table t135(a int);
|
||||
create table t136(a int);
|
||||
create table t137(a int);
|
||||
create table t138(a int);
|
||||
create table t139(a int);
|
||||
create table t140(a int);
|
||||
create table t141(a int);
|
||||
create table t142(a int);
|
||||
create table t143(a int);
|
||||
create table t144(a int);
|
||||
create table t145(a int);
|
||||
create table t146(a int);
|
||||
create table t147(a int);
|
||||
create table t148(a int);
|
||||
create table t149(a int);
|
||||
create table t150(a int);
|
||||
create table t151(a int);
|
||||
create table t152(a int);
|
||||
create table t153(a int);
|
||||
create table t154(a int);
|
||||
create table t155(a int);
|
||||
create table t156(a int);
|
||||
create table t157(a int);
|
||||
create table t158(a int);
|
||||
create table t159(a int);
|
||||
create table t160(a int);
|
||||
create table t161(a int);
|
||||
create table t162(a int);
|
||||
create table t163(a int);
|
||||
create table t164(a int);
|
||||
create table t165(a int);
|
||||
create table t166(a int);
|
||||
create table t167(a int);
|
||||
create table t168(a int);
|
||||
create table t169(a int);
|
||||
create table t170(a int);
|
||||
create table t171(a int);
|
||||
create table t172(a int);
|
||||
create table t173(a int);
|
||||
create table t174(a int);
|
||||
create table t175(a int);
|
||||
create table t176(a int);
|
||||
create table t177(a int);
|
||||
create table t178(a int);
|
||||
create table t179(a int);
|
||||
create table t180(a int);
|
||||
create table t181(a int);
|
||||
create table t182(a int);
|
||||
create table t183(a int);
|
||||
create table t184(a int);
|
||||
create table t185(a int);
|
||||
create table t186(a int);
|
||||
create table t187(a int);
|
||||
create table t188(a int);
|
||||
create table t189(a int);
|
||||
create table t190(a int);
|
||||
create table t191(a int);
|
||||
create table t192(a int);
|
||||
create table t193(a int);
|
||||
create table t194(a int);
|
||||
create table t195(a int);
|
||||
create table t196(a int);
|
||||
create table t197(a int);
|
||||
create table t198(a int);
|
||||
create table t199(a int);
|
||||
create table t200(a int);
|
||||
create table t201(a int);
|
||||
create table t202(a int);
|
||||
create table t203(a int);
|
||||
create table t204(a int);
|
||||
create table t205(a int);
|
||||
create table t206(a int);
|
||||
create table t207(a int);
|
||||
create table t208(a int);
|
||||
create table t209(a int);
|
||||
create table t210(a int);
|
||||
create table t211(a int);
|
||||
create table t212(a int);
|
||||
create table t213(a int);
|
||||
create table t214(a int);
|
||||
create table t215(a int);
|
||||
create table t216(a int);
|
||||
create table t217(a int);
|
||||
create table t218(a int);
|
||||
create table t219(a int);
|
||||
create table t220(a int);
|
||||
create table t221(a int);
|
||||
create table t222(a int);
|
||||
create table t223(a int);
|
||||
create table t224(a int);
|
||||
create table t225(a int);
|
||||
create table t226(a int);
|
||||
create table t227(a int);
|
||||
create table t228(a int);
|
||||
create table t229(a int);
|
||||
create table t230(a int);
|
||||
create table t231(a int);
|
||||
create table t232(a int);
|
||||
create table t233(a int);
|
||||
create table t234(a int);
|
||||
create table t235(a int);
|
||||
create table t236(a int);
|
||||
create table t237(a int);
|
||||
create table t238(a int);
|
||||
create table t239(a int);
|
||||
create table t240(a int);
|
||||
create table t241(a int);
|
||||
create table t242(a int);
|
||||
create table t243(a int);
|
||||
create table t244(a int);
|
||||
create table t245(a int);
|
||||
create table t246(a int);
|
||||
create table t247(a int);
|
||||
create table t248(a int);
|
||||
create table t249(a int);
|
||||
create table t250(a int);
|
||||
create table t251(a int);
|
||||
create table t252(a int);
|
||||
create table t253(a int);
|
||||
create table t254(a int);
|
||||
create table t255(a int);
|
||||
create table t256(a int);
|
||||
create table t00 (a int) type=MERGE UNION=(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256) INSERT_METHOD=FIRST;
|
||||
insert into t0 values (1),(2);
|
||||
insert into t1 values (1),(2);
|
||||
insert into t2 values (1),(2);
|
||||
insert into t3 values (1),(2);
|
||||
insert into t4 values (1),(2);
|
||||
insert into t5 values (1),(2);
|
||||
insert into t6 values (1),(2);
|
||||
insert into t7 values (1),(2);
|
||||
insert into t8 values (1),(2);
|
||||
insert into t9 values (1),(2);
|
||||
insert into t10 values (1),(2);
|
||||
insert into t11 values (1),(2);
|
||||
insert into t12 values (1),(2);
|
||||
insert into t13 values (1),(2);
|
||||
insert into t14 values (1),(2);
|
||||
insert into t15 values (1),(2);
|
||||
insert into t16 values (1),(2);
|
||||
insert into t17 values (1),(2);
|
||||
insert into t18 values (1),(2);
|
||||
insert into t19 values (1),(2);
|
||||
insert into t20 values (1),(2);
|
||||
insert into t21 values (1),(2);
|
||||
insert into t22 values (1),(2);
|
||||
insert into t23 values (1),(2);
|
||||
insert into t24 values (1),(2);
|
||||
insert into t25 values (1),(2);
|
||||
insert into t26 values (1),(2);
|
||||
insert into t27 values (1),(2);
|
||||
insert into t28 values (1),(2);
|
||||
insert into t29 values (1),(2);
|
||||
insert into t30 values (1),(2);
|
||||
insert into t31 values (1),(2);
|
||||
insert into t32 values (1),(2);
|
||||
insert into t33 values (1),(2);
|
||||
insert into t34 values (1),(2);
|
||||
insert into t35 values (1),(2);
|
||||
insert into t36 values (1),(2);
|
||||
insert into t37 values (1),(2);
|
||||
insert into t38 values (1),(2);
|
||||
insert into t39 values (1),(2);
|
||||
insert into t40 values (1),(2);
|
||||
insert into t41 values (1),(2);
|
||||
insert into t42 values (1),(2);
|
||||
insert into t43 values (1),(2);
|
||||
insert into t44 values (1),(2);
|
||||
insert into t45 values (1),(2);
|
||||
insert into t46 values (1),(2);
|
||||
insert into t47 values (1),(2);
|
||||
insert into t48 values (1),(2);
|
||||
insert into t49 values (1),(2);
|
||||
insert into t50 values (1),(2);
|
||||
insert into t51 values (1),(2);
|
||||
insert into t52 values (1),(2);
|
||||
insert into t53 values (1),(2);
|
||||
insert into t54 values (1),(2);
|
||||
insert into t55 values (1),(2);
|
||||
insert into t56 values (1),(2);
|
||||
insert into t57 values (1),(2);
|
||||
insert into t58 values (1),(2);
|
||||
insert into t59 values (1),(2);
|
||||
insert into t60 values (1),(2);
|
||||
insert into t61 values (1),(2);
|
||||
insert into t62 values (1),(2);
|
||||
insert into t63 values (1),(2);
|
||||
insert into t64 values (1),(2);
|
||||
insert into t65 values (1),(2);
|
||||
insert into t66 values (1),(2);
|
||||
insert into t67 values (1),(2);
|
||||
insert into t68 values (1),(2);
|
||||
insert into t69 values (1),(2);
|
||||
insert into t70 values (1),(2);
|
||||
insert into t71 values (1),(2);
|
||||
insert into t72 values (1),(2);
|
||||
insert into t73 values (1),(2);
|
||||
insert into t74 values (1),(2);
|
||||
insert into t75 values (1),(2);
|
||||
insert into t76 values (1),(2);
|
||||
insert into t77 values (1),(2);
|
||||
insert into t78 values (1),(2);
|
||||
insert into t79 values (1),(2);
|
||||
insert into t80 values (1),(2);
|
||||
insert into t81 values (1),(2);
|
||||
insert into t82 values (1),(2);
|
||||
insert into t83 values (1),(2);
|
||||
insert into t84 values (1),(2);
|
||||
insert into t85 values (1),(2);
|
||||
insert into t86 values (1),(2);
|
||||
insert into t87 values (1),(2);
|
||||
insert into t88 values (1),(2);
|
||||
insert into t89 values (1),(2);
|
||||
insert into t90 values (1),(2);
|
||||
insert into t91 values (1),(2);
|
||||
insert into t92 values (1),(2);
|
||||
insert into t93 values (1),(2);
|
||||
insert into t94 values (1),(2);
|
||||
insert into t95 values (1),(2);
|
||||
insert into t96 values (1),(2);
|
||||
insert into t97 values (1),(2);
|
||||
insert into t98 values (1),(2);
|
||||
insert into t99 values (1),(2);
|
||||
insert into t100 values (1),(2);
|
||||
insert into t101 values (1),(2);
|
||||
insert into t102 values (1),(2);
|
||||
insert into t103 values (1),(2);
|
||||
insert into t104 values (1),(2);
|
||||
insert into t105 values (1),(2);
|
||||
insert into t106 values (1),(2);
|
||||
insert into t107 values (1),(2);
|
||||
insert into t108 values (1),(2);
|
||||
insert into t109 values (1),(2);
|
||||
insert into t110 values (1),(2);
|
||||
insert into t111 values (1),(2);
|
||||
insert into t112 values (1),(2);
|
||||
insert into t113 values (1),(2);
|
||||
insert into t114 values (1),(2);
|
||||
insert into t115 values (1),(2);
|
||||
insert into t116 values (1),(2);
|
||||
insert into t117 values (1),(2);
|
||||
insert into t118 values (1),(2);
|
||||
insert into t119 values (1),(2);
|
||||
insert into t120 values (1),(2);
|
||||
insert into t121 values (1),(2);
|
||||
insert into t122 values (1),(2);
|
||||
insert into t123 values (1),(2);
|
||||
insert into t124 values (1),(2);
|
||||
insert into t125 values (1),(2);
|
||||
insert into t126 values (1),(2);
|
||||
insert into t127 values (1),(2);
|
||||
insert into t128 values (1),(2);
|
||||
insert into t129 values (1),(2);
|
||||
insert into t130 values (1),(2);
|
||||
insert into t131 values (1),(2);
|
||||
insert into t132 values (1),(2);
|
||||
insert into t133 values (1),(2);
|
||||
insert into t134 values (1),(2);
|
||||
insert into t135 values (1),(2);
|
||||
insert into t136 values (1),(2);
|
||||
insert into t137 values (1),(2);
|
||||
insert into t138 values (1),(2);
|
||||
insert into t139 values (1),(2);
|
||||
insert into t140 values (1),(2);
|
||||
insert into t141 values (1),(2);
|
||||
insert into t142 values (1),(2);
|
||||
insert into t143 values (1),(2);
|
||||
insert into t144 values (1),(2);
|
||||
insert into t145 values (1),(2);
|
||||
insert into t146 values (1),(2);
|
||||
insert into t147 values (1),(2);
|
||||
insert into t148 values (1),(2);
|
||||
insert into t149 values (1),(2);
|
||||
insert into t150 values (1),(2);
|
||||
insert into t151 values (1),(2);
|
||||
insert into t152 values (1),(2);
|
||||
insert into t153 values (1),(2);
|
||||
insert into t154 values (1),(2);
|
||||
insert into t155 values (1),(2);
|
||||
insert into t156 values (1),(2);
|
||||
insert into t157 values (1),(2);
|
||||
insert into t158 values (1),(2);
|
||||
insert into t159 values (1),(2);
|
||||
insert into t160 values (1),(2);
|
||||
insert into t161 values (1),(2);
|
||||
insert into t162 values (1),(2);
|
||||
insert into t163 values (1),(2);
|
||||
insert into t164 values (1),(2);
|
||||
insert into t165 values (1),(2);
|
||||
insert into t166 values (1),(2);
|
||||
insert into t167 values (1),(2);
|
||||
insert into t168 values (1),(2);
|
||||
insert into t169 values (1),(2);
|
||||
insert into t170 values (1),(2);
|
||||
insert into t171 values (1),(2);
|
||||
insert into t172 values (1),(2);
|
||||
insert into t173 values (1),(2);
|
||||
insert into t174 values (1),(2);
|
||||
insert into t175 values (1),(2);
|
||||
insert into t176 values (1),(2);
|
||||
insert into t177 values (1),(2);
|
||||
insert into t178 values (1),(2);
|
||||
insert into t179 values (1),(2);
|
||||
insert into t180 values (1),(2);
|
||||
insert into t181 values (1),(2);
|
||||
insert into t182 values (1),(2);
|
||||
insert into t183 values (1),(2);
|
||||
insert into t184 values (1),(2);
|
||||
insert into t185 values (1),(2);
|
||||
insert into t186 values (1),(2);
|
||||
insert into t187 values (1),(2);
|
||||
insert into t188 values (1),(2);
|
||||
insert into t189 values (1),(2);
|
||||
insert into t190 values (1),(2);
|
||||
insert into t191 values (1),(2);
|
||||
insert into t192 values (1),(2);
|
||||
insert into t193 values (1),(2);
|
||||
insert into t194 values (1),(2);
|
||||
insert into t195 values (1),(2);
|
||||
insert into t196 values (1),(2);
|
||||
insert into t197 values (1),(2);
|
||||
insert into t198 values (1),(2);
|
||||
insert into t199 values (1),(2);
|
||||
insert into t200 values (1),(2);
|
||||
insert into t201 values (1),(2);
|
||||
insert into t202 values (1),(2);
|
||||
insert into t203 values (1),(2);
|
||||
insert into t204 values (1),(2);
|
||||
insert into t205 values (1),(2);
|
||||
insert into t206 values (1),(2);
|
||||
insert into t207 values (1),(2);
|
||||
insert into t208 values (1),(2);
|
||||
insert into t209 values (1),(2);
|
||||
insert into t210 values (1),(2);
|
||||
insert into t211 values (1),(2);
|
||||
insert into t212 values (1),(2);
|
||||
insert into t213 values (1),(2);
|
||||
insert into t214 values (1),(2);
|
||||
insert into t215 values (1),(2);
|
||||
insert into t216 values (1),(2);
|
||||
insert into t217 values (1),(2);
|
||||
insert into t218 values (1),(2);
|
||||
insert into t219 values (1),(2);
|
||||
insert into t220 values (1),(2);
|
||||
insert into t221 values (1),(2);
|
||||
insert into t222 values (1),(2);
|
||||
insert into t223 values (1),(2);
|
||||
insert into t224 values (1),(2);
|
||||
insert into t225 values (1),(2);
|
||||
insert into t226 values (1),(2);
|
||||
insert into t227 values (1),(2);
|
||||
insert into t228 values (1),(2);
|
||||
insert into t229 values (1),(2);
|
||||
insert into t230 values (1),(2);
|
||||
insert into t231 values (1),(2);
|
||||
insert into t232 values (1),(2);
|
||||
insert into t233 values (1),(2);
|
||||
insert into t234 values (1),(2);
|
||||
insert into t235 values (1),(2);
|
||||
insert into t236 values (1),(2);
|
||||
insert into t237 values (1),(2);
|
||||
insert into t238 values (1),(2);
|
||||
insert into t239 values (1),(2);
|
||||
insert into t240 values (1),(2);
|
||||
insert into t241 values (1),(2);
|
||||
insert into t242 values (1),(2);
|
||||
insert into t243 values (1),(2);
|
||||
insert into t244 values (1),(2);
|
||||
insert into t245 values (1),(2);
|
||||
insert into t246 values (1),(2);
|
||||
insert into t247 values (1),(2);
|
||||
insert into t248 values (1),(2);
|
||||
insert into t249 values (1),(2);
|
||||
insert into t250 values (1),(2);
|
||||
insert into t251 values (1),(2);
|
||||
insert into t252 values (1),(2);
|
||||
insert into t253 values (1),(2);
|
||||
insert into t254 values (1),(2);
|
||||
insert into t255 values (1),(2);
|
||||
insert into t256 values (1),(2);
|
||||
select count(*) from t00;
|
||||
count(*)
|
||||
514
|
||||
select count(*) from t00;
|
||||
count(*)
|
||||
514
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 1
|
||||
delete from t256;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t00;
|
||||
|
20
mysql-test/r/query_cache_merge.result
Normal file
20
mysql-test/r/query_cache_merge.result
Normal file
@ -0,0 +1,20 @@
|
||||
SET @@global.query_cache_size=1355776;
|
||||
flush status;
|
||||
select count(*) from t00;
|
||||
count(*)
|
||||
514
|
||||
select count(*) from t00;
|
||||
count(*)
|
||||
514
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 1
|
||||
delete from t256;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00;
|
||||
SET @@global.query_cache_size=0;
|
@ -226,3 +226,63 @@ insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"),
|
||||
select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1;
|
||||
id1 idnull
|
||||
drop table t1;
|
||||
create table t1 (x int, y int, index(x), index(y));
|
||||
insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
update t1 set y=x;
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t2 range x x 5 NULL 4 Using where
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t2 range x x 5 NULL 4 Using where
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 1)
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 1)
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where
|
||||
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref y y 5 const 1 Using where
|
||||
1 SIMPLE t2 range x x 5 NULL 2 Using where
|
||||
explain select count(*) from t1 where x in (1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range x x 5 NULL 1 Using where; Using index
|
||||
explain select count(*) from t1 where x in (1,2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range x x 5 NULL 2 Using where; Using index
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1));
|
||||
INSERT INTO t1 VALUES (0),(0),(1),(1);
|
||||
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
|
||||
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
|
||||
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using where; Using index
|
||||
1 SIMPLE t1 ALL i1,i2 NULL NULL NULL 4 Range checked for each record (index map: 3)
|
||||
explain select * from t1 force index(i2), t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using where; Using index
|
||||
1 SIMPLE t1 ALL i2 NULL NULL NULL 4 Range checked for each record (index map: 2)
|
||||
DROP TABLE t1,t2;
|
||||
create table t1 (id int(10) primary key);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
select id from t1 where id in (2,5,9) ;
|
||||
id
|
||||
2
|
||||
5
|
||||
9
|
||||
select id from t1 where id=2 or id=5 or id=9 ;
|
||||
id
|
||||
2
|
||||
5
|
||||
9
|
||||
drop table t1;
|
||||
|
@ -4,20 +4,20 @@ File Position Binlog_do_db Binlog_ignore_db
|
||||
master-bin.000001 79
|
||||
reset slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
change master to master_host='127.0.0.1';
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 test MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 test MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No
|
||||
change master to master_host='127.0.0.1',master_user='root',
|
||||
master_password='',master_port=MASTER_PORT;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 7 master-bin.000001 79 slave-relay-bin.000001 123 master-bin.000001 Yes Yes 0 0 79 123
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 7 master-bin.000001 79 slave-relay-bin.000001 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
insert into t1 values (10),(45),(90);
|
||||
|
@ -5,7 +5,7 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
load table t1 from master;
|
||||
ERROR 08S01: Error connecting to master: Master is not configured
|
||||
load table t1 from master;
|
||||
|
@ -8,8 +8,8 @@ create table t1 (a int primary key);
|
||||
insert into t1 values (1),(1);
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t1 0 0 213 257
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t1 0 0 213 257 None 0 No
|
||||
show tables like 't1';
|
||||
Tables_in_test (t1)
|
||||
drop table t1;
|
||||
|
@ -13,5 +13,5 @@ master_password='',master_port=SLAVE_PORT;
|
||||
start slave;
|
||||
flush logs;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 79 relay-log.000002 4 slave-bin.000001 Yes Yes 0 0 79 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 79 relay-log.000002 4 slave-bin.000001 Yes Yes 0 0 79 4 None 0 No
|
||||
|
@ -4,6 +4,7 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
reset master;
|
||||
create table t1(a int not null auto_increment, b int, primary key(a) );
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
||||
@ -19,6 +20,9 @@ day id category name
|
||||
2003-02-22 2461 b a a a @ % ' " a
|
||||
2003-03-22 2161 c asdf
|
||||
2003-04-22 2416 a bbbbb
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
slave-bin.000001 964
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
@ -28,8 +32,8 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 1311 slave-relay-bin.000002 1355 master-bin.000001 Yes Yes 0 0 1311 1355
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 1311 slave-relay-bin.000002 1355 master-bin.000001 Yes Yes 0 0 1311 1355 None 0 No
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
@ -38,8 +42,8 @@ stop slave;
|
||||
change master to master_user='test';
|
||||
change master to master_user='root';
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 1442 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 1442 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 1442 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 1442 4 None 0 No
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
set sql_log_bin=0;
|
||||
@ -49,5 +53,5 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
stop slave;
|
||||
reset slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No
|
||||
|
14
mysql-test/r/rpl_loaddata_rule_m.result
Normal file
14
mysql-test/r/rpl_loaddata_rule_m.result
Normal file
@ -0,0 +1,14 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
reset master;
|
||||
create database test2;
|
||||
create table t1(a int, b int, unique(b));
|
||||
use test2;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
drop database test2;
|
14
mysql-test/r/rpl_loaddata_rule_s.result
Normal file
14
mysql-test/r/rpl_loaddata_rule_s.result
Normal file
@ -0,0 +1,14 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
reset master;
|
||||
create table t1(a int, b int, unique(b));
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
@ -12,7 +12,10 @@ create table t1(n int not null auto_increment primary key);
|
||||
insert into t1 values (NULL);
|
||||
drop table t1;
|
||||
create table t1 (word char(20) not null);
|
||||
load data infile '../../std_data/words.dat' into table t1;
|
||||
load data infile '../../std_data/words.dat' into table t1 ignore 1 lines;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
69
|
||||
drop table t1;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
@ -81,18 +84,18 @@ slave-bin.000001 200 Query 1 200 use `test`; insert into t1 values (NULL)
|
||||
slave-bin.000001 263 Query 1 263 use `test`; drop table t1
|
||||
slave-bin.000001 311 Query 1 311 use `test`; create table t1 (word char(20) not null)
|
||||
slave-bin.000001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581
|
||||
slave-bin.000001 1065 Exec_load 1 1056 ;file_id=1
|
||||
slave-bin.000001 1088 Query 1 1079 use `test`; drop table t1
|
||||
slave-bin.000001 1136 Query 1 4 use `test`; create table t5 (a int)
|
||||
slave-bin.000001 1194 Query 1 62 use `test`; drop table t5
|
||||
slave-bin.000001 1065 Exec_load 1 1065 ;file_id=1
|
||||
slave-bin.000001 1088 Query 1 1088 use `test`; drop table t1
|
||||
slave-bin.000001 1136 Query 1 1136 use `test`; create table t5 (a int)
|
||||
slave-bin.000001 1194 Query 1 1194 use `test`; drop table t5
|
||||
slave-bin.000001 1242 Rotate 2 1242 slave-bin.000002;pos=4
|
||||
show binlog events in 'slave-bin.000002' from 4;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
slave-bin.000002 4 Query 1 110 use `test`; create table t1 (n int)
|
||||
slave-bin.000002 62 Query 1 168 use `test`; insert into t1 values (1)
|
||||
slave-bin.000002 122 Query 1 228 use `test`; drop table t1
|
||||
slave-bin.000002 4 Query 1 4 use `test`; create table t1 (n int)
|
||||
slave-bin.000002 62 Query 1 62 use `test`; insert into t1 values (1)
|
||||
slave-bin.000002 122 Query 1 122 use `test`; drop table t1
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000002 276 slave-relay-bin.000003 214 master-bin.000002 Yes Yes 0 0 276 214
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000002 276 slave-relay-bin.000003 214 master-bin.000002 Yes Yes 0 0 276 214 None 0 No
|
||||
show binlog events in 'slave-bin.000005' from 4;
|
||||
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
|
||||
|
@ -8,26 +8,26 @@ show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
master-bin.000001 79
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No
|
||||
stop slave;
|
||||
change master to master_log_pos=73;
|
||||
start slave;
|
||||
stop slave;
|
||||
change master to master_log_pos=73;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 73 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 73 4 None 0 No
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 48 master-bin.000001 No Yes 0 0 73 48
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 48 master-bin.000001 No Yes 0 0 73 48 None 0 No
|
||||
stop slave;
|
||||
change master to master_log_pos=173;
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 173 slave-relay-bin.000001 4 master-bin.000001 No Yes 0 0 173 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 173 slave-relay-bin.000001 4 master-bin.000001 No Yes 0 0 173 4 None 0 No
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
master-bin.000001 79
|
||||
|
@ -15,8 +15,8 @@ select @@global.max_relay_log_size;
|
||||
4096
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000014 1221 master-bin.000001 Yes Yes 0 0 50477 1221
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000014 1221 master-bin.000001 Yes Yes 0 0 50477 1221 None 0 No
|
||||
stop slave;
|
||||
reset slave;
|
||||
set global max_relay_log_size=(5*4096);
|
||||
@ -25,8 +25,8 @@ select @@global.max_relay_log_size;
|
||||
20480
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000004 9457 master-bin.000001 Yes Yes 0 0 50477 9457
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000004 9457 master-bin.000001 Yes Yes 0 0 50477 9457 None 0 No
|
||||
stop slave;
|
||||
reset slave;
|
||||
set global max_relay_log_size=0;
|
||||
@ -35,26 +35,26 @@ select @@global.max_relay_log_size;
|
||||
0
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000008 1283 master-bin.000001 Yes Yes 0 0 50477 1283
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000008 1283 master-bin.000001 Yes Yes 0 0 50477 1283 None 0 No
|
||||
stop slave;
|
||||
reset slave;
|
||||
flush logs;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No
|
||||
reset slave;
|
||||
start slave;
|
||||
flush logs;
|
||||
create table t1 (a int);
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50535 slave-relay-bin.000009 62 master-bin.000001 Yes Yes 0 0 50535 62
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50535 slave-relay-bin.000009 62 master-bin.000001 Yes Yes 0 0 50535 62 None 0 No
|
||||
flush logs;
|
||||
drop table t1;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50583 slave-relay-bin.000010 52 master-bin.000001 Yes Yes 0 0 50583 52
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 50583 slave-relay-bin.000010 52 master-bin.000001 Yes Yes 0 0 50583 52 None 0 No
|
||||
flush logs;
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
|
30
mysql-test/r/rpl_openssl.result
Normal file
30
mysql-test/r/rpl_openssl.result
Normal file
@ -0,0 +1,30 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
grant replication slave on *.* to replssl@'%' require ssl;
|
||||
create table t1 (t int);
|
||||
stop slave;
|
||||
change master to master_user='replssl',master_password='';
|
||||
start slave;
|
||||
insert into t1 values (1);
|
||||
select * from t1;
|
||||
t
|
||||
stop slave;
|
||||
change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
|
||||
start slave;
|
||||
select * from t1;
|
||||
t
|
||||
1
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 replssl MASTER_MYPORT 1 master-bin.000001 289 slave-relay-bin.000001 108 master-bin.000001 Yes Yes 0 0 289 108 None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem
|
||||
stop slave;
|
||||
change master to master_user='root',master_password='', master_ssl=0;
|
||||
start slave;
|
||||
drop table t1;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 337 slave-relay-bin.000001 96 master-bin.000001 Yes Yes 0 0 337 96 None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem
|
@ -5,7 +5,7 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
SHOW SLAVE STATUS;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
SHOW SLAVE HOSTS;
|
||||
Server_id Host Port Rpl_recovery_rank Master_id
|
||||
2 127.0.0.1 SLAVE_PORT 2 1
|
||||
|
@ -10,9 +10,9 @@ reset slave;
|
||||
start slave;
|
||||
stop slave;
|
||||
start slave;
|
||||
select master_pos_wait('master-bin.001',3000,120)=-1;
|
||||
master_pos_wait('master-bin.001',3000,120)=-1
|
||||
0
|
||||
select master_pos_wait('master-bin.001',3000)>=0;
|
||||
master_pos_wait('master-bin.001',3000)>=0
|
||||
1
|
||||
select * from t1 where a=8000;
|
||||
a
|
||||
8000
|
||||
|
@ -27,5 +27,5 @@ select * from t11;
|
||||
ERROR 42S02: Table 'test.t11' doesn't exist
|
||||
drop table if exists t1,t2,t11;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 1281 slave-relay-bin.000002 1325 master-bin.000001 Yes Yes test.t1 0 0 1281 1325
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 1281 slave-relay-bin.000002 1325 master-bin.000001 Yes Yes test.t1 0 0 1281 1325 None 0 No
|
||||
|
@ -5,18 +5,18 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No
|
||||
stop slave;
|
||||
change master to master_user='test';
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 test MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 79 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 test MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 79 4 None 0 No
|
||||
reset slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No
|
||||
start slave;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No
|
||||
|
@ -15,8 +15,8 @@ insert into temp_table values ("testing temporary tables");
|
||||
create table t1 (s text);
|
||||
insert into t1 values('Could not break slave'),('Tried hard');
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 60 master-bin.000001 417 slave-relay-bin.000001 461 master-bin.000001 Yes Yes 0 0 417 461
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 60 master-bin.000001 417 slave-relay-bin.000001 461 master-bin.000001 Yes Yes 0 0 417 461 None 0 No
|
||||
select * from t1;
|
||||
s
|
||||
Could not break slave
|
||||
@ -56,8 +56,8 @@ Log_name
|
||||
master-bin.000003
|
||||
insert into t2 values (65);
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 60 master-bin.000003 290 slave-relay-bin.000001 1088 master-bin.000003 Yes Yes 0 0 290 1088
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 60 master-bin.000003 290 slave-relay-bin.000001 1088 master-bin.000003 Yes Yes 0 0 290 1088 None 0 No
|
||||
select * from t2;
|
||||
m
|
||||
34
|
||||
@ -80,8 +80,8 @@ select * from t4;
|
||||
a
|
||||
testing temporary tables part 2
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root MASTER_PORT 60 master-bin.000004 2886 slave-relay-bin.000001 7891 master-bin.000004 Yes Yes 0 0 2886 7891
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_PORT 60 master-bin.000004 2886 slave-relay-bin.000001 7891 master-bin.000004 Yes Yes 0 0 2886 7891 None 0 No
|
||||
lock tables t3 read;
|
||||
select count(*) from t3 where n >= 4;
|
||||
count(*)
|
||||
|
72
mysql-test/r/rpl_until.result
Normal file
72
mysql-test/r/rpl_until.result
Normal file
@ -0,0 +1,72 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
stop slave;
|
||||
create table t1(n int not null auto_increment primary key);
|
||||
insert into t1 values (1),(2),(3),(4);
|
||||
drop table t1;
|
||||
create table t2(n int not null auto_increment primary key);
|
||||
insert into t2 values (1),(2);
|
||||
insert into t2 values (3),(4);
|
||||
drop table t2;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
|
||||
master-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key)
|
||||
master-bin.000001 172 Query 1 172 use `test`; insert into t1 values (1),(2),(3),(4)
|
||||
master-bin.000001 244 Query 1 244 use `test`; drop table t1
|
||||
master-bin.000001 292 Query 1 292 use `test`; create table t2(n int not null auto_increment primary key)
|
||||
master-bin.000001 385 Query 1 385 use `test`; insert into t2 values (1),(2)
|
||||
master-bin.000001 449 Query 1 449 use `test`; insert into t2 values (3),(4)
|
||||
master-bin.000001 513 Query 1 513 use `test`; drop table t2
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=244;
|
||||
select * from t1;
|
||||
n
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 332 master-bin.000001 Yes No 0 0 244 649 Master master-bin.000001 244 No
|
||||
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
|
||||
select * from t1;
|
||||
n
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 332 master-bin.000001 Yes No 0 0 244 649 Master master-no-such-bin.000001 291 No
|
||||
start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537;
|
||||
select * from t2;
|
||||
n
|
||||
1
|
||||
2
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 537 master-bin.000001 Yes No 0 0 449 649 Relay slave-relay-bin.000002 537 No
|
||||
start slave;
|
||||
stop slave;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=561;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key
|
||||
127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 649 master-bin.000001 Yes No 0 0 561 693 Master master-bin.000001 561 No
|
||||
start slave until master_log_file='master-bin', master_log_pos=561;
|
||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
|
||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
||||
start slave until master_log_file='master-bin.000001';
|
||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
||||
start slave until relay_log_file='slave-relay-bin.000002';
|
||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
||||
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
||||
start slave sql_thread;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=561;
|
||||
Warnings:
|
||||
Note 1253 Slave is already running
|
@ -21,6 +21,7 @@ set @q:='abc';
|
||||
insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
|
||||
set @a:=5;
|
||||
insert into t1 values (@a),(@a);
|
||||
insert into t1 values (@a),(@a),(@a*5);
|
||||
select * from t1;
|
||||
n
|
||||
12345678901234
|
||||
@ -45,6 +46,36 @@ abcn1
|
||||
abcn1n2
|
||||
5
|
||||
5
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
select * from t1;
|
||||
n
|
||||
12345678901234
|
||||
-12345678901234
|
||||
0
|
||||
-1
|
||||
12.5
|
||||
-12.5
|
||||
This is a test
|
||||
|
||||
abc'def
|
||||
abc\def
|
||||
abc'def
|
||||
NULL
|
||||
NULL
|
||||
0
|
||||
1
|
||||
2
|
||||
5
|
||||
abc
|
||||
abcn1
|
||||
abcn1n2
|
||||
5
|
||||
5
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
show binlog events from 141;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
slave-bin.000001 141 User var 2 141 @i1=12345678901234
|
||||
@ -63,13 +94,16 @@ slave-bin.000001 719 User var 2 719 @s5='abc'def'
|
||||
slave-bin.000001 761 Query 1 761 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
|
||||
slave-bin.000001 851 User var 2 851 @n1=NULL
|
||||
slave-bin.000001 877 Query 1 877 use `test`; insert into t1 values (@n1)
|
||||
slave-bin.000001 939 Query 1 939 use `test`; insert into t1 values (@n2)
|
||||
slave-bin.000001 1001 Query 1 1001 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
|
||||
slave-bin.000001 1089 User var 2 1089 @a=2
|
||||
slave-bin.000001 1131 Query 1 1131 use `test`; insert into t1 values (@a+(@b:=@a+1))
|
||||
slave-bin.000001 1203 User var 2 1203 @q='abc'
|
||||
slave-bin.000001 1240 Query 1 1240 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
|
||||
slave-bin.000001 1344 User var 2 1344 @a=5
|
||||
slave-bin.000001 1386 Query 1 1386 use `test`; insert into t1 values (@a),(@a)
|
||||
slave-bin.000001 939 User var 2 939 @n2=NULL
|
||||
slave-bin.000001 965 Query 1 965 use `test`; insert into t1 values (@n2)
|
||||
slave-bin.000001 1027 Query 1 1027 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
|
||||
slave-bin.000001 1115 User var 2 1115 @a=2
|
||||
slave-bin.000001 1157 Query 1 1157 use `test`; insert into t1 values (@a+(@b:=@a+1))
|
||||
slave-bin.000001 1229 User var 2 1229 @q='abc'
|
||||
slave-bin.000001 1266 Query 1 1266 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
|
||||
slave-bin.000001 1370 User var 2 1370 @a=5
|
||||
slave-bin.000001 1412 Query 1 1412 use `test`; insert into t1 values (@a),(@a)
|
||||
slave-bin.000001 1478 User var 2 1478 @a=NULL
|
||||
slave-bin.000001 1503 Query 1 1503 use `test`; insert into t1 values (@a),(@a),(@a*5)
|
||||
drop table t1;
|
||||
stop slave;
|
||||
|
@ -1,14 +0,0 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (id int(10) primary key);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
select id from t1 where id in (2,5,9) ;
|
||||
id
|
||||
2
|
||||
5
|
||||
9
|
||||
select id from t1 where id=2 or id=5 or id=9 ;
|
||||
id
|
||||
2
|
||||
5
|
||||
9
|
||||
drop table t1;
|
@ -1,38 +0,0 @@
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(75) DEFAULT '' NOT NULL,
|
||||
LINK_ID int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME),
|
||||
KEY LINK_ID (LINK_ID)
|
||||
);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
|
||||
CREATE TABLE t2 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(150) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME)
|
||||
);
|
||||
SELECT DISTINCT
|
||||
t2.id AS key_link_id,
|
||||
t2.name AS link
|
||||
FROM t1
|
||||
LEFT JOIN t2 ON t1.link_id=t2.id
|
||||
GROUP BY t1.id
|
||||
ORDER BY link;
|
||||
key_link_id link
|
||||
NULL NULL
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
html varchar(5) default NULL,
|
||||
rin int(11) default '0',
|
||||
out int(11) default '0'
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('1',1,0);
|
||||
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
html prod
|
||||
1 0.00
|
||||
drop table t1;
|
@ -67,12 +67,12 @@ analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
|
||||
explain select * from t1,t1 as t2 where t1.b=t2.b;
|
||||
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL b NULL NULL NULL 21
|
||||
1 SIMPLE t2 ALL b NULL NULL NULL 16 Using where
|
||||
set MAX_SEEKS_FOR_KEY=1;
|
||||
explain select * from t1,t1 as t2 where t1.b=t2.b;
|
||||
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL b NULL NULL NULL 21
|
||||
1 SIMPLE t2 ref b b 21 test.t1.b 6 Using where
|
||||
|
@ -43,7 +43,7 @@ wait_timeout 28800
|
||||
show variables like "this_doesn't_exists%";
|
||||
Variable_name Value
|
||||
show table status from test like "this_doesn't_exists%";
|
||||
Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Charset Create_options Comment
|
||||
Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
show databases;
|
||||
Database
|
||||
mysql
|
||||
@ -227,6 +227,12 @@ select * from t1;
|
||||
type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob
|
||||
0 1 NULL NULL NULL NULL NULL NULL NULL NULL 2003-02-07 10:00:01 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL NULL NULL NULL NULL NULL
|
||||
drop table t1;
|
||||
create table t1 (a int not null);
|
||||
create table t2 select max(a) from t1;
|
||||
show columns from t2;
|
||||
Field Type Null Key Default Extra
|
||||
max(a) bigint(20) YES NULL
|
||||
drop table t1,t2;
|
||||
create table t1 (c decimal, d double, f float, r real);
|
||||
show columns from t1;
|
||||
Field Type Null Key Default Extra
|
||||
|
@ -42,6 +42,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
|
||||
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1275 Field or reference 'a' of SELECT #3 was resolved in SELECT #1
|
||||
Note 1275 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
|
||||
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
|
||||
1
|
||||
1
|
||||
@ -207,6 +210,8 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t4 ALL NULL NULL NULL NULL 3
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2
|
||||
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where
|
||||
Warnings:
|
||||
Note 1275 Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1
|
||||
select * from t3 where exists (select * from t2 where t2.b=t3.a);
|
||||
a
|
||||
7
|
||||
@ -290,8 +295,11 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2
|
||||
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1
|
||||
3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 Using where
|
||||
Warnings:
|
||||
Note 1275 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1275 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1
|
||||
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
|
||||
create table t7( uq int primary key, name char(25));
|
||||
insert into t7 values(1,"Oblastnaia bolnitsa"),(2,"Bolnitsa Krasnogo Kresta");
|
||||
@ -305,6 +313,8 @@ explain select * from t6 where exists (select * from t7 where uq = clinic_uq);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t6 ALL NULL NULL NULL NULL 4 Using where
|
||||
2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1
|
||||
Warnings:
|
||||
Note 1275 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
|
||||
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
|
||||
ERROR 23000: Column: 'a' in field list is ambiguous
|
||||
drop table if exists t1,t2,t3;
|
||||
@ -348,7 +358,7 @@ SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce');
|
||||
pseudo
|
||||
joce
|
||||
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo LIKE '%joce%');
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
|
||||
CREATE TABLE `t1` (
|
||||
`topic` mediumint(8) unsigned NOT NULL default '0',
|
||||
@ -378,7 +388,7 @@ SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1;
|
||||
1
|
||||
1
|
||||
SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1;
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 index NULL topic 3 NULL 2 Using index
|
||||
@ -465,9 +475,9 @@ UNIQUE KEY `maxnumrep` (`maxnumrep`)
|
||||
) TYPE=MyISAM ROW_FORMAT=FIXED;
|
||||
INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1);
|
||||
select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1);
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
select numeropost as a FROM t1 ORDER BY (SELECT 1 FROM t1 HAVING a=1);
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
@ -480,7 +490,7 @@ drop table t1;
|
||||
CREATE TABLE t1 (field char(1) NOT NULL DEFAULT 'b');
|
||||
INSERT INTO t1 VALUES ();
|
||||
SELECT field FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) a HAVING field='b');
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
drop table t1;
|
||||
CREATE TABLE `t1` (
|
||||
`numeropost` mediumint(8) unsigned NOT NULL default '0',
|
||||
@ -498,7 +508,7 @@ SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=1) FROM (SELECT
|
||||
numreponse (SELECT numeropost FROM t1 HAVING numreponse=1)
|
||||
INSERT INTO t1 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test');
|
||||
EXPLAIN SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1');
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
EXPLAIN SELECT MAX(numreponse) FROM t1 WHERE numeropost='1';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
@ -525,7 +535,7 @@ a b
|
||||
update t1 set b= (select b from t1);
|
||||
ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
||||
update t1 set b= (select b from t2);
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
update t1 set b= (select b from t2 where t1.a = t2.a);
|
||||
select * from t1;
|
||||
a b
|
||||
@ -548,7 +558,7 @@ a b
|
||||
delete from t1 where b = (select b from t1);
|
||||
ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
||||
delete from t1 where b = (select b from t2);
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
delete from t1 where b = (select b from t2 where t1.a = t2.a);
|
||||
select * from t1;
|
||||
a b
|
||||
@ -574,7 +584,7 @@ a b
|
||||
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
|
||||
ERROR HY000: You can't specify target table 't12' for update in FROM clause
|
||||
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
|
||||
select * from t11;
|
||||
a b
|
||||
@ -593,7 +603,7 @@ insert into t3 values (1),(2);
|
||||
INSERT INTO t1 (x) VALUES ((SELECT x FROM t1));
|
||||
ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
||||
INSERT INTO t1 (x) VALUES ((SELECT b FROM t3));
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
INSERT INTO t1 (x) VALUES ((SELECT a FROM t2));
|
||||
select * from t1;
|
||||
x
|
||||
@ -635,7 +645,7 @@ x y
|
||||
replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2));
|
||||
ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
||||
replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2));
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2));
|
||||
select * from t1;
|
||||
x y
|
||||
@ -706,7 +716,7 @@ id
|
||||
CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin1;
|
||||
INSERT INTO t1 values (1),(1);
|
||||
UPDATE t2 SET id=(SELECT * FROM t1);
|
||||
ERROR 21000: Subselect returns more than 1 record
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
drop table t2, t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
@ -813,6 +823,7 @@ explain select (select a+1) from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
|
||||
Warnings:
|
||||
Note 1275 Field or reference 'a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1248 Select 2 was reduced during optimisation
|
||||
select (select a+1) from t1;
|
||||
(select a+1)
|
||||
@ -833,7 +844,7 @@ a t1.a in (select t2.a from t2)
|
||||
explain SELECT t1.a, t1.a in (select t2.a from t2) FROM t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 Using index
|
||||
2 DEPENDENT SUBQUERY t2 index_in a a 5 func 2 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t2 index_subquery a a 5 func 2 Using index
|
||||
CREATE TABLE t3 (a int(11) default '0');
|
||||
INSERT INTO t3 VALUES (1),(2),(3);
|
||||
SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
|
||||
@ -1039,6 +1050,9 @@ t1 CREATE TABLE `t1` (
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a;
|
||||
select * from t1;
|
||||
a
|
||||
2
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -1176,7 +1190,7 @@ insert into t1 values (1,0), (2,0), (3,0);
|
||||
insert into t2 values (1,1), (2,1), (3,1), (2,2);
|
||||
update ignore t1 set b=(select b from t2 where t1.a=t2.a);
|
||||
Warnings:
|
||||
Error 1241 Subselect returns more than 1 record
|
||||
Error 1241 Subquery returns more than 1 row
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
@ -1244,7 +1258,7 @@ a
|
||||
explain select * from t2 where t2.a in (select a from t1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 simple_in PRIMARY PRIMARY 4 func 1 Using index
|
||||
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
|
||||
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
|
||||
a
|
||||
2
|
||||
@ -1252,7 +1266,7 @@ a
|
||||
explain select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 simple_in PRIMARY PRIMARY 4 func 1 Using index; Using where
|
||||
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
|
||||
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
|
||||
a
|
||||
2
|
||||
@ -1277,7 +1291,7 @@ a
|
||||
explain select * from t2 where t2.a in (select a from t1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 index_in a a 5 func 1001 Using index
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index
|
||||
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
|
||||
a
|
||||
2
|
||||
@ -1285,7 +1299,7 @@ a
|
||||
explain select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 index_in a a 5 func 1001 Using index; Using where
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where
|
||||
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
|
||||
a
|
||||
2
|
||||
@ -1308,7 +1322,7 @@ a
|
||||
explain select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 index_in a a 5 func 1001 Using index; Using where
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where
|
||||
drop table t1, t2, t3;
|
||||
create table t1 (a int, b int);
|
||||
create table t2 (a int, b int);
|
||||
@ -1348,6 +1362,60 @@ a
|
||||
2
|
||||
10
|
||||
drop table t1,t2,t3;
|
||||
CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci,
|
||||
s2 CHAR(5) COLLATE latin1_swedish_ci);
|
||||
INSERT INTO t1 VALUES ('z','?');
|
||||
select * from t1 where s1 > (select max(s2) from t1);
|
||||
ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>'
|
||||
select * from t1 where s1 > any (select max(s2) from t1);
|
||||
ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>'
|
||||
drop table t1;
|
||||
create table t1(toid int,rd int);
|
||||
create table t2(userid int,pmnew int,pmtotal int);
|
||||
insert into t2 values(1,0,0),(2,0,0);
|
||||
insert into t1 values(1,0),(1,0),(1,0),(1,12),(1,15),(1,123),(1,12312),(1,12312),(1,123),(2,0),(2,0),(2,1),(2,2);
|
||||
select userid,pmtotal,pmnew, (select count(rd) from t1 where toid=t2.userid) calc_total, (select count(rd) from t1 where rd=0 and toid=t2.userid) calc_new from t2 where userid in (select distinct toid from t1);
|
||||
userid pmtotal pmnew calc_total calc_new
|
||||
1 0 0 9 3
|
||||
2 0 0 4 2
|
||||
drop table t1, t2;
|
||||
create table t1 (s1 char(5));
|
||||
select (select 'a','b' from t1 union select 'a','b' from t1) from t1;
|
||||
ERROR 21000: Cardinality error (more/less than 1 columns)
|
||||
insert into t1 values ('tttt');
|
||||
select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1);
|
||||
s1
|
||||
tttt
|
||||
explain (select * from t1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
||||
(select * from t1);
|
||||
s1
|
||||
tttt
|
||||
drop table t1;
|
||||
create table t1 (s1 char(5), index s1(s1));
|
||||
create table t2 (s1 char(5), index s1(s1));
|
||||
insert into t1 values ('a1'),('a2'),('a3');
|
||||
insert into t2 values ('a1'),('a2');
|
||||
select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
|
||||
s1 s1 NOT IN (SELECT s1 FROM t2)
|
||||
a1 0
|
||||
a2 0
|
||||
a3 1
|
||||
select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
|
||||
s1 s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')
|
||||
a1 0
|
||||
a2 1
|
||||
a3 1
|
||||
explain select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
|
||||
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
|
||||
explain select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
|
||||
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where
|
||||
drop table t1,t2;
|
||||
create table t2 (a int, b int);
|
||||
create table t3 (a int);
|
||||
insert into t3 values (6),(7),(3);
|
||||
|
@ -123,9 +123,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 system PRIMARY NULL NULL NULL 0 const row not found
|
||||
1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 9 Using where
|
||||
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 32 test.t2.DOCTYPEID 1
|
||||
2 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
3 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
4 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
5 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
6 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
3 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
4 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
5 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
6 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
drop table t1, t2, t3, t4;
|
||||
|
@ -40,14 +40,12 @@ t9 CREATE TABLE `t9` (
|
||||
`b` char(16) NOT NULL default '',
|
||||
`c` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
) TYPE=MyISAM CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
|
||||
alter table t9 rename t8, add column d int not null;
|
||||
alter table t8 rename t7;
|
||||
rename table t7 to t9;
|
||||
drop table t1;
|
||||
Got one of the listed errors
|
||||
Warnings:
|
||||
Note 1008 Can't drop database 'test_mysqltest'; database doesn't exist
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
@ -64,5 +62,5 @@ t9 CREATE TABLE `t9` (
|
||||
`c` int(11) NOT NULL default '0',
|
||||
`d` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
) TYPE=MyISAM CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
|
||||
drop database mysqltest;
|
||||
|
50
mysql-test/r/type_nchar.result
Normal file
50
mysql-test/r/type_nchar.result
Normal file
@ -0,0 +1,50 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (c nchar(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) character set utf8 default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (c national char(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) character set utf8 default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (c national varchar(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` varchar(10) character set utf8 default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (c nvarchar(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` varchar(10) character set utf8 default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (c nchar varchar(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` varchar(10) character set utf8 default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (c national character varying(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` varchar(10) character set utf8 default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (c nchar varying(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` varchar(10) character set utf8 default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
drop table t1;
|
@ -103,7 +103,7 @@ a b
|
||||
2 b
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
8
|
||||
explain select a,b from t1 union all select a,b from t2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
|
||||
@ -312,6 +312,127 @@ a b
|
||||
5 f
|
||||
6 e
|
||||
drop table t1,t2,t3,t4;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
create table t2 (a int);
|
||||
insert into t2 values (3),(4),(5);
|
||||
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1;
|
||||
a
|
||||
1
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2;
|
||||
a
|
||||
1
|
||||
3
|
||||
select found_rows();
|
||||
found_rows()
|
||||
4
|
||||
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2);
|
||||
a
|
||||
1
|
||||
3
|
||||
4
|
||||
5
|
||||
select found_rows();
|
||||
found_rows()
|
||||
4
|
||||
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1);
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
3
|
||||
select found_rows();
|
||||
found_rows()
|
||||
4
|
||||
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
|
||||
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
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
|
||||
a
|
||||
1
|
||||
3
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2;
|
||||
a
|
||||
1
|
||||
2
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2;
|
||||
a
|
||||
1
|
||||
2
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 100;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
select found_rows();
|
||||
found_rows()
|
||||
5
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2;
|
||||
a
|
||||
1
|
||||
3
|
||||
4
|
||||
5
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2 LIMIT 2;
|
||||
a
|
||||
1
|
||||
3
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2,2;
|
||||
a
|
||||
3
|
||||
4
|
||||
select found_rows();
|
||||
found_rows()
|
||||
6
|
||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2;
|
||||
a
|
||||
3
|
||||
4
|
||||
5
|
||||
select found_rows();
|
||||
found_rows()
|
||||
5
|
||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1;
|
||||
a
|
||||
5
|
||||
(SELECT * FROM t1 ORDER by a) UNION ALL (SELECT * FROM t2 ORDER BY a) ORDER BY A desc LIMIT 4;
|
||||
a
|
||||
5
|
||||
4
|
||||
3
|
||||
3
|
||||
(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1;
|
||||
ERROR 42000: Wrong usage/placement of 'SQL_CALC_FOUND_ROWS'
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 ( id int(3) unsigned default '0') TYPE=MyISAM;
|
||||
INSERT INTO t1 (id) VALUES("1");
|
||||
CREATE TABLE t2 ( id int(3) unsigned default '0', id_master int(5) default '0', text1 varchar(5) default NULL, text2 varchar(5) default NULL) TYPE=MyISAM;
|
||||
|
@ -5,6 +5,10 @@ set @a := connection_id() + 3;
|
||||
select @a - connection_id();
|
||||
@a - connection_id()
|
||||
3
|
||||
set @b := 1;
|
||||
select @b;
|
||||
@b
|
||||
1
|
||||
CREATE TABLE t1 ( i int not null, v int not null,index (i));
|
||||
insert into t1 values (1,1),(1,3),(2,1);
|
||||
create table t2 (i int not null, unique (i));
|
||||
|
5
mysql-test/std_data/loaddata2.dat
Normal file
5
mysql-test/std_data/loaddata2.dat
Normal file
@ -0,0 +1,5 @@
|
||||
Field A,'Field B'
|
||||
Field 1,'Field 2'
|
||||
Field 3,'Field 4'
|
||||
'Field 5' ,'Field 6'
|
||||
Field 6, 'Field 7'
|
@ -776,3 +776,16 @@ select * from t1;
|
||||
select * from t2;
|
||||
select * from t2;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# The bug #971
|
||||
#
|
||||
|
||||
create table t1 (x int not null, index(x)) type=bdb;
|
||||
insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
select * from t1 where x <= 10 and x >= 7;
|
||||
select * from t1 where x <= 10 and x >= 7 order by x;
|
||||
select * from t1 where x <= 10 and x >= 7 order by x desc;
|
||||
select * from t1 where x <= 8 and x >= 5 order by x desc;
|
||||
select * from t1 where x < 8 and x > 5 order by x desc;
|
||||
drop table t1;
|
||||
|
@ -48,8 +48,9 @@ flush privileges;
|
||||
#connect (con1,localhost,test,gambling2,"");
|
||||
#show tables;
|
||||
connect (con1,localhost,test,gambling2,mysql);
|
||||
set password=old_password('gambling3');
|
||||
show tables;
|
||||
connect (con1,localhost,test,gambling2,test);
|
||||
connect (con1,localhost,test,gambling3,test);
|
||||
show tables;
|
||||
|
||||
# Re enable this one day if error handling on connect will take place
|
||||
@ -63,7 +64,9 @@ show tables;
|
||||
#connect (con1,localhost,test,zorro,);
|
||||
#--error 1045
|
||||
|
||||
|
||||
# remove user 'test' so that other tests which may use 'test'
|
||||
# do not depend on this test.
|
||||
|
||||
delete from mysql.user where user="test";
|
||||
flush privileges;
|
||||
|
@ -219,6 +219,60 @@ drop table t1;
|
||||
#
|
||||
# Bug # 801
|
||||
#
|
||||
|
||||
create table t1 select x'4132';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test types of data for create select with functions
|
||||
#
|
||||
|
||||
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
|
||||
insert into t1(a)values(1);
|
||||
insert into t1(a,b,c,d,e,f,g,h)
|
||||
values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data');
|
||||
select * from t1;
|
||||
select a,
|
||||
ifnull(b,cast(-7 as signed)) as b,
|
||||
ifnull(c,cast(7 as unsigned)) as c,
|
||||
ifnull(d,cast('2000-01-01' as date)) as d,
|
||||
ifnull(e,cast('b' as char)) as e,
|
||||
ifnull(f,cast('2000-01-01' as datetime)) as f,
|
||||
ifnull(g,cast('5:4:3' as time)) as g,
|
||||
ifnull(h,cast('yet another binary data' as binary)) as h,
|
||||
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
|
||||
from t1;
|
||||
|
||||
create table t2
|
||||
select
|
||||
a,
|
||||
ifnull(b,cast(-7 as signed)) as b,
|
||||
ifnull(c,cast(7 as unsigned)) as c,
|
||||
ifnull(d,cast('2000-01-01' as date)) as d,
|
||||
ifnull(e,cast('b' as char)) as e,
|
||||
ifnull(f,cast('2000-01-01' as datetime)) as f,
|
||||
ifnull(g,cast('5:4:3' as time)) as g,
|
||||
ifnull(h,cast('yet another binary data' as binary)) as h,
|
||||
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
|
||||
from t1;
|
||||
explain t2;
|
||||
|
||||
select * from t2;
|
||||
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug #1209
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists test_$1;
|
||||
--enable_warnings
|
||||
create database test_$1;
|
||||
use test_$1;
|
||||
select database();
|
||||
drop database test_$1;
|
||||
select database();
|
||||
|
||||
# Connect without a database
|
||||
connect (user4,localhost,mysqltest_1,,*NO-ONE*);
|
||||
select database();
|
||||
|
@ -6,3 +6,14 @@ SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8, KEY key_a(a(3)));
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW KEYS FROM t1;
|
||||
ALTER TABLE t1 CHANGE a a CHAR(4);
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW KEYS FROM t1;
|
||||
ALTER TABLE t1 CHANGE a a CHAR(4) CHARACTER SET utf8;
|
||||
SHOW CREATE TABLE t1;
|
||||
SHOW KEYS FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -13,8 +13,8 @@ DROP TABLE t1;
|
||||
|
||||
CREATE TABLE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
(
|
||||
<20><><EFBFBD><EFBFBD> CHAR(32) CHARACTER SET koi8r NOT NULL
|
||||
);
|
||||
<20><><EFBFBD><EFBFBD> CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
) COMMENT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
|
||||
SHOW TABLES;
|
||||
SHOW CREATE TABLE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
@ -45,3 +45,8 @@ SHOW TABLES;
|
||||
SHOW TABLES IN <20><><EFBFBD><EFBFBD>;
|
||||
SET CHARACTER SET koi8r;
|
||||
DROP DATABASE <20><><EFBFBD><EFBFBD>;
|
||||
|
||||
SET NAMES koi8r;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
SET character_set_connection=cp1251;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
|
194
mysql-test/t/ctype_ucs.test
Normal file
194
mysql-test/t/ctype_ucs.test
Normal file
@ -0,0 +1,194 @@
|
||||
-- source include/have_ucs2.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
SET CHARACTER SET koi8r;
|
||||
|
||||
#
|
||||
# Check that 0x20 is only trimmed when it is
|
||||
# a part of real SPACE character, not just a part
|
||||
# of a multibyte sequence.
|
||||
# Note, CYRILLIC LETTER ER is used as an example, which
|
||||
# is stored as 0x0420 in UCS2, thus contains 0x20 in the
|
||||
# low byte. The second character is THREE-PER-M, U+2004,
|
||||
# which contains 0x20 in the high byte.
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES (_koi8r'<27>'), (X'2004');
|
||||
SELECT hex(word) FROM t1 ORDER BY word;
|
||||
DELETE FROM t1;
|
||||
|
||||
#
|
||||
# Check that real spaces are correctly trimmed.
|
||||
#
|
||||
|
||||
INSERT INTO t1 VALUES (X'042000200020'), (X'200400200020');
|
||||
SELECT hex(word) FROM t1 ORDER BY word;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Check LPAD/RPAD
|
||||
#
|
||||
SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'0421');
|
||||
SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'04210422');
|
||||
SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'042104220423');
|
||||
SELECT LPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423');
|
||||
|
||||
SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'0421');
|
||||
SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'04210422');
|
||||
SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'042104220423');
|
||||
SELECT RPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423');
|
||||
|
||||
CREATE TABLE t1 SELECT
|
||||
LPAD(_ucs2 X'0420',10,_ucs2 X'0421') l,
|
||||
RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
######################################################
|
||||
#
|
||||
# Test of like
|
||||
#
|
||||
|
||||
SET NAMES koi8r;
|
||||
SET character_set_connection=ucs2;
|
||||
|
||||
create table t1 (a varchar(10) character set ucs2, key(a));
|
||||
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
|
||||
explain select * from t1 where a like 'abc%';
|
||||
explain select * from t1 where a like concat('abc','%');
|
||||
select * from t1 where a like "abc%";
|
||||
select * from t1 where a like concat("abc","%");
|
||||
select * from t1 where a like "ABC%";
|
||||
select * from t1 where a like "test%";
|
||||
select * from t1 where a like "te_t";
|
||||
select * from t1 where a like "%a%";
|
||||
select * from t1 where a like "%abcd%";
|
||||
select * from t1 where a like "%abc\d%";
|
||||
drop table t1;
|
||||
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD>');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
SELECT * FROM t1 WHERE a LIKE '%<25><><EFBFBD><EFBFBD>%';
|
||||
SELECT * FROM t1 WHERE a LIKE '%<25><><EFBFBD>%';
|
||||
SELECT * FROM t1 WHERE a LIKE '<27><><EFBFBD><EFBFBD>%';
|
||||
SELECT * FROM t1 WHERE a LIKE '<27><><EFBFBD><EFBFBD>%' COLLATE ucs2_bin;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug 1181
|
||||
#
|
||||
CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
|
||||
TYPE=MyISAM CHARACTER SET ucs2 COLLATE ucs2_general_ci;
|
||||
INSERT INTO t1 (word) VALUES ("cat");
|
||||
SELECT * FROM t1 WHERE word LIKE "c%";
|
||||
SELECT * FROM t1 WHERE word LIKE "ca_";
|
||||
SELECT * FROM t1 WHERE word LIKE "cat";
|
||||
SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630025';
|
||||
SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630061005F';
|
||||
DROP TABLE t1;
|
||||
|
||||
######################################################
|
||||
|
||||
#
|
||||
# Bug 1264
|
||||
#
|
||||
# Description:
|
||||
#
|
||||
# When using a ucs2 table in MySQL,
|
||||
# either with ucs2_general_ci or ucs2_bin collation,
|
||||
# words are returned in an incorrect order when using ORDER BY
|
||||
# on an _indexed_ CHAR or VARCHAR column. They are sorted with
|
||||
# the longest word *first* instead of last. I.E. The word "aardvark"
|
||||
# is in the results before the word "a".
|
||||
#
|
||||
# If there is no index for the column, the problem does not occur.
|
||||
#
|
||||
# Interestingly, if there is no second column, the words are returned
|
||||
# in the correct order.
|
||||
#
|
||||
# According to EXPLAIN, it looks like when the output includes columns that
|
||||
# are not part of the index sorted on, it does a filesort, which fails.
|
||||
# Using a straight index yields correct results.
|
||||
|
||||
SET NAMES latin1;
|
||||
|
||||
#
|
||||
# Two fields, index
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
word VARCHAR(64),
|
||||
bar INT(11) default 0,
|
||||
PRIMARY KEY (word))
|
||||
TYPE=MyISAM
|
||||
CHARSET ucs2
|
||||
COLLATE ucs2_general_ci ;
|
||||
|
||||
INSERT INTO t1 (word) VALUES ("aar");
|
||||
INSERT INTO t1 (word) VALUES ("a");
|
||||
INSERT INTO t1 (word) VALUES ("aardvar");
|
||||
INSERT INTO t1 (word) VALUES ("aardvark");
|
||||
INSERT INTO t1 (word) VALUES ("aardvara");
|
||||
INSERT INTO t1 (word) VALUES ("aardvarz");
|
||||
EXPLAIN SELECT * FROM t1 ORDER BY word;
|
||||
SELECT * FROM t1 ORDER BY word;
|
||||
EXPLAIN SELECT word FROM t1 ORDER BY word;
|
||||
SELECT word FROM t1 ORDER by word;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# One field, index
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
word VARCHAR(64) ,
|
||||
PRIMARY KEY (word))
|
||||
TYPE=MyISAM
|
||||
CHARSET ucs2
|
||||
COLLATE ucs2_general_ci;
|
||||
|
||||
INSERT INTO t1 (word) VALUES ("aar");
|
||||
INSERT INTO t1 (word) VALUES ("a");
|
||||
INSERT INTO t1 (word) VALUES ("aardvar");
|
||||
INSERT INTO t1 (word) VALUES ("aardvark");
|
||||
INSERT INTO t1 (word) VALUES ("aardvara");
|
||||
INSERT INTO t1 (word) VALUES ("aardvarz");
|
||||
EXPLAIN SELECT * FROM t1 ORDER BY WORD;
|
||||
SELECT * FROM t1 ORDER BY word;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
#
|
||||
# Two fields, no index
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
word TEXT,
|
||||
bar INT(11) AUTO_INCREMENT,
|
||||
PRIMARY KEY (bar))
|
||||
TYPE=MyISAM
|
||||
CHARSET ucs2
|
||||
COLLATE ucs2_general_ci ;
|
||||
INSERT INTO t1 (word) VALUES ("aar");
|
||||
INSERT INTO t1 (word) VALUES ("a" );
|
||||
INSERT INTO t1 (word) VALUES ("aardvar");
|
||||
INSERT INTO t1 (word) VALUES ("aardvark");
|
||||
INSERT INTO t1 (word) VALUES ("aardvara");
|
||||
INSERT INTO t1 (word) VALUES ("aardvarz");
|
||||
EXPLAIN SELECT * FROM t1 ORDER BY word;
|
||||
SELECT * FROM t1 ORDER BY word;
|
||||
EXPLAIN SELECT word FROM t1 ORDER BY word;
|
||||
SELECT word FROM t1 ORDER BY word;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# END OF Bug 1264 test
|
||||
#
|
||||
########################################################
|
||||
|
@ -7,6 +7,8 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
set names ujis;
|
||||
|
||||
#
|
||||
# Test problem with LEFT()
|
||||
#
|
||||
@ -15,3 +17,27 @@ create table t1 (c text character set ujis);
|
||||
insert into t1 values (0xa4a2),(0xa4a3);
|
||||
select hex(left(c,1)) from t1 group by c;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
select locate(0xa2a1,0xa1a2a1a3);
|
||||
select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3);
|
||||
select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin);
|
||||
select locate('he','hello');
|
||||
select locate('he','hello',2);
|
||||
select locate('lo','hello',2);
|
||||
select locate('HE','hello');
|
||||
select locate('HE','hello',2);
|
||||
select locate('LO','hello',2);
|
||||
select locate('HE','hello' collate ujis_bin);
|
||||
select locate('HE','hello' collate ujis_bin,2);
|
||||
select locate('LO','hello' collate ujis_bin,2);
|
||||
select locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3);
|
||||
|
||||
select 0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%');
|
||||
select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%');
|
||||
select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin;
|
||||
select 'a' like 'a';
|
||||
select 'A' like 'a';
|
||||
select 'A' like 'a' collate ujis_bin;
|
||||
|
35
mysql-test/t/ctype_utf8.test
Normal file
35
mysql-test/t/ctype_utf8.test
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# Tests with the utf8 character set
|
||||
#
|
||||
|
||||
set names utf8;
|
||||
|
||||
select left(_utf8 0xD0B0D0B1D0B2,1);
|
||||
select right(_utf8 0xD0B0D0B2D0B2,1);
|
||||
|
||||
select locate('he','hello');
|
||||
select locate('he','hello',2);
|
||||
select locate('lo','hello',2);
|
||||
select locate('HE','hello');
|
||||
select locate('HE','hello',2);
|
||||
select locate('LO','hello',2);
|
||||
select locate('HE','hello' collate utf8_bin);
|
||||
select locate('HE','hello' collate utf8_bin,2);
|
||||
select locate('LO','hello' collate utf8_bin,2);
|
||||
|
||||
select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2);
|
||||
select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2);
|
||||
select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2);
|
||||
select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin);
|
||||
select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin);
|
||||
|
||||
select 'a' like 'a';
|
||||
select 'A' like 'a';
|
||||
select 'A' like 'a' collate utf8_bin;
|
||||
select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%');
|
||||
|
||||
#
|
||||
# Fix this, it should return 1:
|
||||
#
|
||||
#select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD091,_utf8 '%');
|
||||
#
|
@ -94,3 +94,31 @@ drop table t1,t2;
|
||||
# derived table reference
|
||||
#
|
||||
SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
|
||||
|
||||
#
|
||||
# Test for select if database is not selected.
|
||||
#
|
||||
# Connect without a database
|
||||
create table t1 select 1 as a;
|
||||
connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock);
|
||||
connection con1;
|
||||
--error 1046
|
||||
select 2 as a from (select * from t1) b;
|
||||
use test;
|
||||
select 2 as a from (select * from t1) b;
|
||||
drop table t1;
|
||||
--error 1064
|
||||
select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id;
|
||||
|
||||
#
|
||||
# UPDATE/DELETE/INSERT of derived tables
|
||||
#
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
-- error 1149
|
||||
update (select * from t1) as t1 set a = 5;
|
||||
-- error 1064
|
||||
delete from (select * from t1);
|
||||
-- error 1064
|
||||
insert into (select * from t1) values (5);
|
||||
drop table t1;
|
||||
|
@ -285,3 +285,50 @@ INSERT INTO t1 VALUES (3, 'aaaaa');
|
||||
INSERT INTO t1 VALUES (2, 'eeeeeee');
|
||||
select distinct left(name,1) as name from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test case from sel000100
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(75) DEFAULT '' NOT NULL,
|
||||
LINK_ID int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME),
|
||||
KEY LINK_ID (LINK_ID)
|
||||
);
|
||||
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
|
||||
INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
|
||||
|
||||
CREATE TABLE t2 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
NAME varchar(150) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
KEY NAME (NAME)
|
||||
);
|
||||
|
||||
SELECT DISTINCT
|
||||
t2.id AS key_link_id,
|
||||
t2.name AS link
|
||||
FROM t1
|
||||
LEFT JOIN t2 ON t1.link_id=t2.id
|
||||
GROUP BY t1.id
|
||||
ORDER BY link;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# test case for #674
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
html varchar(5) default NULL,
|
||||
rin int(11) default '0',
|
||||
out int(11) default '0'
|
||||
) TYPE=MyISAM;
|
||||
|
||||
INSERT INTO t1 VALUES ('1',1,0);
|
||||
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
drop table t1;
|
||||
|
@ -43,3 +43,13 @@ drop database mysqltest;
|
||||
show databases;
|
||||
--error 1008
|
||||
drop database mysqltest;
|
||||
|
||||
# test create table and FLUSH TABLES WITH READ LOCK
|
||||
drop table t1;
|
||||
flush tables with read lock;
|
||||
--error 1223;
|
||||
create table t1(n int);
|
||||
unlock tables;
|
||||
create table t1(n int);
|
||||
show tables;
|
||||
drop table t1;
|
||||
|
@ -23,3 +23,9 @@ select uncompress("");
|
||||
select uncompress(compress(""));
|
||||
select uncompressed_length("");
|
||||
|
||||
#
|
||||
# NULL (Bug #1333)
|
||||
#
|
||||
|
||||
select compress(NULL);
|
||||
select uncompress(NULL);
|
||||
|
@ -4,7 +4,33 @@ select length(encrypt('foo', 'ff')) <> 0;
|
||||
--replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l.
|
||||
|
||||
# Test new and old password handling functions
|
||||
select password("a",""), password("a",NULL), password("","a"), password(NULL,"a");
|
||||
select password("aaaaaaaaaaaaaaaa","a"), password("a","aaaaaaaaaaaaaaaa");
|
||||
select old_password('test'), length(password("1")), length(encrypt('test')), encrypt('test','aa');
|
||||
select old_password(""), old_password(NULL), password(""), password(NULL);
|
||||
select password('abc');
|
||||
select password('');
|
||||
select old_password('abc');
|
||||
select old_password('');
|
||||
select password('gabbagabbahey');
|
||||
select old_password('idkfa');
|
||||
select length(password('1'));
|
||||
select length(encrypt('test'));
|
||||
select encrypt('test','aa');
|
||||
select old_password(NULL);
|
||||
select password(NULL);
|
||||
set global old_passwords=on;
|
||||
select password('');
|
||||
select old_password('');
|
||||
select password('idkfa');
|
||||
select old_password('idkfa');
|
||||
set old_passwords=on;
|
||||
select password('idkfa');
|
||||
select old_password('idkfa');
|
||||
set global old_passwords=off;
|
||||
select password('idkfa');
|
||||
select old_password('idkfa');
|
||||
|
||||
# this test shows that new scrambles honor spaces in passwords:
|
||||
set old_passwords=off;
|
||||
select password('idkfa ');
|
||||
select password('idkfa');
|
||||
select password(' idkfa');
|
||||
select old_password('idkfa');
|
||||
select old_password(' i d k f a ');
|
||||
|
@ -91,6 +91,11 @@ insert into t2 values (1,4), (5,4), (5,5);
|
||||
--replace_result www.help.com X www.host.com X www.google.com X
|
||||
select REQ_ID, Group_Concat(URL) as URL from t1, t2 where
|
||||
t2.URL_ID = t1.URL_ID group by REQ_ID;
|
||||
# check min/max function
|
||||
--replace_result www.help.com X www.host.com X www.google.com X
|
||||
select REQ_ID, Group_Concat(URL) as URL, Min(t1.URL_ID) urll,
|
||||
Max(t1.URL_ID)
|
||||
urlg from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID;
|
||||
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
@ -99,3 +104,19 @@ insert into t1 values (1,'longername'),(1,'evenlongername');
|
||||
insert into t1 values (1,'longername'),(1,'evenlongername');
|
||||
select ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'without distinct: how it should be' from t1;
|
||||
select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1;
|
||||
drop table t1;
|
||||
|
||||
# check zero rows
|
||||
create table t1(id int);
|
||||
create table t2(id int);
|
||||
insert into t1 values(0),(1);
|
||||
select group_concat(t1.id) FROM t1,t2;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
||||
# check having
|
||||
create table t1 (bar varchar(32));
|
||||
insert into t1 values('test'),('test2');
|
||||
select * from t1 having group_concat(bar)='';
|
||||
drop table t1;
|
||||
|
||||
|
@ -45,3 +45,17 @@ create table t1 (xxx char(128));
|
||||
insert into t1 (xxx) values('this is some text: to test - out.reg exp (22/45)');
|
||||
select * from t1 where xxx REGEXP '^this is some text: to test - out\\.reg exp [[(][0-9]+[/\\][0-9]+[])][ ]*$';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Check with different character sets and collations
|
||||
#
|
||||
select _latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin;
|
||||
select _koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin;
|
||||
select _latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin;
|
||||
select _koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin;
|
||||
|
||||
select _latin1 0xF7 regexp _latin1 '[[:alpha:]]';
|
||||
select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]';
|
||||
|
||||
select _latin1'a' regexp _latin1'A' collate latin1_general_ci;
|
||||
select _latin1'a' regexp _latin1'A' collate latin1_bin;
|
||||
|
@ -1,3 +1,6 @@
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
#
|
||||
# Testing of comparison functions
|
||||
#
|
||||
@ -65,3 +68,13 @@ select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A';
|
||||
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin;
|
||||
--error 1266
|
||||
select _koi8r'a' LIKE _latin1'A';
|
||||
|
||||
#
|
||||
# Test for LEAST() BUG in LEFT JOIN
|
||||
#
|
||||
CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','<as-html>\r\n<table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"><3E></td>\r\n <td width=\"97%\">\r\n <h3><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000000\">How \r\n To</font><!-- #BeginEditable \"CS_troubleshoot_question\" --><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000099\"><font color=\"#000000\">: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected. </font></font><!-- #EndEditable --></h3>\r\n </td>\r\n </tr>\r\n</table>','<as-html>\r\n <table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"><3E></td>\r\n \r\n<td width=\"97%\"><!-- #BeginEditable \"CS_troubleshoot_answer\" --> \r\n \r\n<p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">1. Select \r\n the <i>On/Setup</i> button to access the DynaVox Setup Menu.<br>\r\n 2. Select <b>Button Features.</b><br>\r\n 3. Below the <b>OK</b> button is the <b>Usage Counts</b> button.<br>\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.<br>\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.<br>\r\n c. Select the <b>Usage Counts</b> Option Ring once and it will toggle \r\n to the alternative option.<br>\r\n 4. Once the correct setting has been chosen, select <b>OK</b> to leave the <i>Button \r\n Features</i> menu.<br>\r\n 5. Select <b>OK</b> out of the <i>Setup</i> menu and return to the communication \r\n page.</font></p>\r\n <p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">For \r\n further information on <i>Usage Counts,</i> see the <i>Button Features \r\n Menu Entry</i> in the DynaVox/DynaMyte Reference Manual.</font></p>\r\n<!-- #EndEditable --></td>\r\n </tr>\r\n</table>',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL);
|
||||
CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) TYPE=MyISAM;
|
||||
INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1);
|
||||
SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank;
|
||||
DROP TABLE t1,t2;
|
||||
|
@ -65,14 +65,24 @@ show grants for mysqltest_1@localhost;
|
||||
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
|
||||
REVOKE select (a), update on t1 from mysqltest_1@localhost;
|
||||
show grants for mysqltest_1@localhost;
|
||||
REVOKE insert,insert (a) on t1 from mysqltest_1@localhost;
|
||||
GRANT references on t1 to mysqltest_1@localhost;
|
||||
REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost;
|
||||
show grants for mysqltest_1@localhost;
|
||||
GRANT select,references on t1 to mysqltest_1@localhost;
|
||||
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
|
||||
delete from mysql.user where user='mysqltest_1';
|
||||
delete from mysql.db where user='mysqltest_1';
|
||||
delete from mysql.tables_priv where user='mysqltest_1';
|
||||
delete from mysql.columns_priv where user='mysqltest_1';
|
||||
grant all on test.* to mysqltest_3@localhost with grant option;
|
||||
revoke all on test.* from mysqltest_3@localhost;
|
||||
show grants for mysqltest_3@localhost;
|
||||
revoke grant option on test.* from mysqltest_3@localhost;
|
||||
show grants for mysqltest_3@localhost;
|
||||
grant all on test.t1 to mysqltest_2@localhost with grant option;
|
||||
revoke all on test.t1 from mysqltest_2@localhost;
|
||||
show grants for mysqltest_2@localhost;
|
||||
revoke grant option on test.t1 from mysqltest_2@localhost;
|
||||
show grants for mysqltest_2@localhost;
|
||||
delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
|
||||
delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
|
||||
delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
|
||||
delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
|
||||
flush privileges;
|
||||
drop table t1;
|
||||
|
||||
|
@ -429,4 +429,6 @@ select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(q
|
||||
select id, sum(qty) as sqty from t1 group by id having sqty>2 and count(qty)>1;
|
||||
select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sqty>2 and cqty>1;
|
||||
select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and count(qty)>1;
|
||||
select count(*), case interval(qty,2,3,4,5,6,7,8) when -1 then NULL when 0 then "zero" when 1 then "one" when 2 then "two" end as category from t1 group by category;
|
||||
select count(*), interval(qty,2,3,4,5,6,7,8) as category from t1 group by category;
|
||||
drop table t1;
|
||||
|
@ -133,6 +133,21 @@ select n from t1;
|
||||
rollback;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test for commit and FLUSH TABLES WITH READ LOCK
|
||||
#
|
||||
|
||||
create table t1 (n int not null primary key) type=innodb;
|
||||
start transaction;
|
||||
insert into t1 values (4);
|
||||
flush tables with read lock;
|
||||
--error 1223;
|
||||
commit;
|
||||
unlock tables;
|
||||
commit;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Testing transactions
|
||||
#
|
||||
@ -925,3 +940,29 @@ SELECT t2.id, t1.label FROM t2 INNER JOIN
|
||||
(SELECT t1.id_object as id_object FROM t1 WHERE t1.label LIKE '%test%') AS lbl
|
||||
ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug #1078
|
||||
#
|
||||
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) type=innodb;
|
||||
select * from t1;
|
||||
--error 1031
|
||||
replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12");
|
||||
select * from t1;
|
||||
--error 1031
|
||||
replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" );
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int, b varchar(200), c text not null) checksum=1 type=myisam;
|
||||
create table t2 (a int, b varchar(200), c text not null) checksum=0 type=innodb;
|
||||
create table t3 (a int, b varchar(200), c text not null) checksum=1 type=innodb;
|
||||
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
|
||||
insert t2 select * from t1;
|
||||
insert t3 select * from t1;
|
||||
checksum table t1, t2, t3, t4 quick;
|
||||
checksum table t1, t2, t3, t4;
|
||||
checksum table t1, t2, t3, t4 extended;
|
||||
#show table status;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
|
@ -70,3 +70,176 @@ show columns from t1;
|
||||
show full columns from t1;
|
||||
show index from t1;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# test of table with huge number of packed fields
|
||||
#
|
||||
|
||||
create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
|
||||
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
||||
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
|
||||
int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int,
|
||||
i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51
|
||||
int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int,
|
||||
i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68
|
||||
int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int,
|
||||
i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85
|
||||
int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int,
|
||||
i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102
|
||||
int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110
|
||||
int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118
|
||||
int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126
|
||||
int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134
|
||||
int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142
|
||||
int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150
|
||||
int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158
|
||||
int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166
|
||||
int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174
|
||||
int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182
|
||||
int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190
|
||||
int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198
|
||||
int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206
|
||||
int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214
|
||||
int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222
|
||||
int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230
|
||||
int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238
|
||||
int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246
|
||||
int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254
|
||||
int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262
|
||||
int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270
|
||||
int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278
|
||||
int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286
|
||||
int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294
|
||||
int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302
|
||||
int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310
|
||||
int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318
|
||||
int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326
|
||||
int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334
|
||||
int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342
|
||||
int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350
|
||||
int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358
|
||||
int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366
|
||||
int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374
|
||||
int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382
|
||||
int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390
|
||||
int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398
|
||||
int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406
|
||||
int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414
|
||||
int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422
|
||||
int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430
|
||||
int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438
|
||||
int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446
|
||||
int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454
|
||||
int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462
|
||||
int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470
|
||||
int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478
|
||||
int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486
|
||||
int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494
|
||||
int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502
|
||||
int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510
|
||||
int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518
|
||||
int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526
|
||||
int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534
|
||||
int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542
|
||||
int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550
|
||||
int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558
|
||||
int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566
|
||||
int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574
|
||||
int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582
|
||||
int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590
|
||||
int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598
|
||||
int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606
|
||||
int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614
|
||||
int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622
|
||||
int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630
|
||||
int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638
|
||||
int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646
|
||||
int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654
|
||||
int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662
|
||||
int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670
|
||||
int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678
|
||||
int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686
|
||||
int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694
|
||||
int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702
|
||||
int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710
|
||||
int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718
|
||||
int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726
|
||||
int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734
|
||||
int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742
|
||||
int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750
|
||||
int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758
|
||||
int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766
|
||||
int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774
|
||||
int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782
|
||||
int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790
|
||||
int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798
|
||||
int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806
|
||||
int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814
|
||||
int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822
|
||||
int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830
|
||||
int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838
|
||||
int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846
|
||||
int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854
|
||||
int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862
|
||||
int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870
|
||||
int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878
|
||||
int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886
|
||||
int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894
|
||||
int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902
|
||||
int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910
|
||||
int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918
|
||||
int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926
|
||||
int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934
|
||||
int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942
|
||||
int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950
|
||||
int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958
|
||||
int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966
|
||||
int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
||||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob) row_format=dynamic;
|
||||
insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei");
|
||||
update t1 set b=repeat('a',256);
|
||||
update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
|
||||
check table t1;
|
||||
drop table t1;
|
||||
|
@ -16,6 +16,7 @@ load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated
|
||||
SELECT * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
|
||||
|
||||
create table t1 (a text, b text);
|
||||
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
|
||||
select concat('|',a,'|'), concat('|',b,'|') from t1;
|
||||
drop table t1;
|
||||
|
@ -6,8 +6,8 @@ connect (con2,localhost,root,,);
|
||||
connection con1;
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1(a int) type=innodb;
|
||||
--enable_warnings
|
||||
lock tables t1 write;
|
||||
insert into t1 values(10);
|
||||
disconnect con1;
|
||||
|
@ -9,6 +9,10 @@ drop table if exists t1,t2,t3;
|
||||
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
|
||||
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
|
||||
SELECT * FROM t1;
|
||||
SELECT T1.id from T1 LIMIT 1;
|
||||
SELECT T2.id from t1 as T2 LIMIT 1;
|
||||
# This gave an error in 4.0, but it's fixed in 4.1
|
||||
SELECT T2.id from t1 as t2 LIMIT 1;
|
||||
RENAME TABLE T1 TO T2;
|
||||
ALTER TABLE T2 ADD new_col int not null;
|
||||
ALTER TABLE T2 RENAME T3;
|
||||
|
175
mysql-test/t/mix_innodb_myisam_binlog.test
Normal file
175
mysql-test/t/mix_innodb_myisam_binlog.test
Normal file
@ -0,0 +1,175 @@
|
||||
# Check that binlog is ok when a transaction mixes updates to InnoDB and
|
||||
# MyISAM.
|
||||
# It would be nice to make this a replication test, but in 4.0 the
|
||||
# slave is always with --skip-innodb in the testsuite. I (Guilhem) however
|
||||
# did some tests manually on a slave; tables are replicated fine and
|
||||
# Exec_master_log_pos advances as expected.
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
connection con1;
|
||||
create table t1 (a int) type=innodb;
|
||||
create table t2 (a int) type=myisam;
|
||||
|
||||
reset master;
|
||||
|
||||
begin;
|
||||
insert into t1 values(1);
|
||||
insert into t2 select * from t1;
|
||||
commit;
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
begin;
|
||||
insert into t1 values(2);
|
||||
insert into t2 select * from t1;
|
||||
# should say some changes to non-transact1onal tables couldn't be rolled back
|
||||
rollback;
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
begin;
|
||||
insert into t1 values(3);
|
||||
savepoint my_savepoint;
|
||||
insert into t1 values(4);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
commit;
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
begin;
|
||||
insert into t1 values(5);
|
||||
savepoint my_savepoint;
|
||||
insert into t1 values(6);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
insert into t1 values(7);
|
||||
commit;
|
||||
select a from t1 order by a; # check that savepoints work :)
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
# and when ROLLBACK is not explicit?
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
select get_lock("a",10);
|
||||
begin;
|
||||
insert into t1 values(8);
|
||||
insert into t2 select * from t1;
|
||||
disconnect con1;
|
||||
|
||||
connection con2;
|
||||
# We want to SHOW BINLOG EVENTS, to know what was logged. But there is no
|
||||
# guarantee that logging of the terminated con1 has been done yet (it may not
|
||||
# even be started, so con1 may have not even attempted to lock the binlog yet;
|
||||
# so SHOW BINLOG EVENTS may come before con1 does the loggin. To be sure that
|
||||
# logging has been done, we use a user lock.
|
||||
select get_lock("a",10);
|
||||
show binlog events from 79;
|
||||
|
||||
# and when not in a transact1on?
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
insert into t1 values(9);
|
||||
insert into t2 select * from t1;
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
# Check that when the query updat1ng the MyISAM table is the first in the
|
||||
# transact1on, we log it immediately.
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
insert into t1 values(10); # first make t1 non-empty
|
||||
begin;
|
||||
insert into t2 select * from t1;
|
||||
show binlog events from 79;
|
||||
insert into t1 values(11);
|
||||
commit;
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
|
||||
# Check that things work like before this BEGIN/ROLLBACK code was added,
|
||||
# when t2 is INNODB
|
||||
|
||||
alter table t2 type=INNODB;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
begin;
|
||||
insert into t1 values(12);
|
||||
insert into t2 select * from t1;
|
||||
commit;
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
begin;
|
||||
insert into t1 values(13);
|
||||
insert into t2 select * from t1;
|
||||
rollback;
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
begin;
|
||||
insert into t1 values(14);
|
||||
savepoint my_savepoint;
|
||||
insert into t1 values(15);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
commit;
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
|
||||
begin;
|
||||
insert into t1 values(16);
|
||||
savepoint my_savepoint;
|
||||
insert into t1 values(17);
|
||||
insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
insert into t1 values(18);
|
||||
commit;
|
||||
select a from t1 order by a; # check that savepoints work :)
|
||||
|
||||
show binlog events from 79;
|
||||
|
||||
drop table t1,t2;
|
@ -268,3 +268,10 @@ create table t2(Z varchar(15));
|
||||
insert into t2(Z) select concat(a.a,b.a,c.a,d.a) from t1 as a, t1 as b, t1 as c, t1 as d;
|
||||
update t2,t3 set Z =param_scenario_costs;
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (a int, b int);
|
||||
create table t2 (a int, b int);
|
||||
insert into t1 values (1,1),(2,1),(3,1);
|
||||
insert into t2 values (1,1), (3,1);
|
||||
update t1 left join t2 on t1.a=t2.a set t1.b=2, t2.b=2 where t1.b=1 and t2.b=1 or t2.a is NULL;
|
||||
select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL;
|
||||
drop table t1,t2;
|
||||
|
@ -295,6 +295,12 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei");
|
||||
update t1 set b=repeat('a',256);
|
||||
update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
|
||||
check table t1;
|
||||
delete from t1 where i8=1;
|
||||
select i1,i2 from t1;
|
||||
check table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
@ -356,6 +362,40 @@ explain select * from t1 where c=1;
|
||||
explain select * from t1 use index() where c=1;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Test bug when updating a split dynamic row where keys are not changed
|
||||
#
|
||||
|
||||
create table t1 (a int not null auto_increment primary key, b varchar(255));
|
||||
insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100));
|
||||
update t1 set b=repeat(left(b,1),200) where a=1;
|
||||
delete from t1 where (a & 1)= 0;
|
||||
update t1 set b=repeat('e',200) where a=1;
|
||||
flush tables;
|
||||
check table t1;
|
||||
|
||||
#
|
||||
# check updating with keys
|
||||
#
|
||||
|
||||
disable_query_log;
|
||||
let $1 = 100;
|
||||
while ($1)
|
||||
{
|
||||
eval insert into t1 (b) values (repeat(char(($1 & 32)+65), $1));
|
||||
dec $1;
|
||||
}
|
||||
enable_query_log;
|
||||
update t1 set b=repeat(left(b,1),255) where a between 1 and 5;
|
||||
update t1 set b=repeat(left(b,1),10) where a between 32 and 43;
|
||||
update t1 set b=repeat(left(b,1),2) where a between 64 and 66;
|
||||
update t1 set b=repeat(left(b,1),65) where a between 67 and 70;
|
||||
check table t1;
|
||||
insert into t1 (b) values (repeat('z',100));
|
||||
update t1 set b="test" where left(b,1) > 'n';
|
||||
check table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test RTREE index
|
||||
#
|
||||
@ -363,4 +403,14 @@ drop table t1,t2;
|
||||
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) TYPE=MyISAM;
|
||||
# INSERT INTO t1 VALUES (1,1),(1,1);
|
||||
# DELETE FROM rt WHERE a<1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
# DROP TABLE IF EXISTS t1;
|
||||
|
||||
create table t1 (a int, b varchar(200), c text not null) checksum=1;
|
||||
create table t2 (a int, b varchar(200), c text not null) checksum=0;
|
||||
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
|
||||
insert t2 select * from t1;
|
||||
checksum table t1, t2, t3 quick;
|
||||
checksum table t1, t2, t3;
|
||||
checksum table t1, t2, t3 extended;
|
||||
#show table status;
|
||||
drop table t1,t2;
|
||||
|
10
mysql-test/t/mysqldump.test
Normal file
10
mysql-test/t/mysqldump.test
Normal file
@ -0,0 +1,10 @@
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
# XML output
|
||||
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
--exec $MYSQL_DUMP -X test t1
|
||||
DROP TABLE t1;
|
@ -77,3 +77,14 @@ select product, country_id , year, sum(profit) from t1 group by product, country
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Test bug with const tables
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (i int);
|
||||
INSERT INTO t1 VALUES(100);
|
||||
CREATE TABLE t2 (i int);
|
||||
INSERT INTO t2 VALUES (100),(200);
|
||||
SELECT i, COUNT(*) FROM t1 GROUP BY i WITH ROLLUP;
|
||||
SELECT t1.i, t2.i, COUNT(*) FROM t1,t2 GROUP BY t1.i,t2.i WITH ROLLUP;
|
||||
drop table t1,t2;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user