mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
merge
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged libmysqld/Makefile.am: Auto merged mysql-test/mysql-test-run.sh: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/log_event.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/bdb/dist/configure.ac: Auto merged storage/innobase/os/os0file.c: Auto merged storage/innobase/os/os0sync.c: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/mi_open.c: Auto merged storage/ndb/src/common/logger/Logger.cpp: Auto merged storage/ndb/src/cw/cpcd/main.cpp: Auto merged storage/ndb/test/ndbapi/testBlobs.cpp: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged
This commit is contained in:
@ -35,7 +35,8 @@ testdir = $(benchdir_root)/mysql-test
|
||||
EXTRA_SCRIPTS = mysql-test-run.sh mysql-test-run.pl install_test_db.sh valgrind.supp
|
||||
EXTRA_DIST = $(EXTRA_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
|
||||
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem \
|
||||
std_data/server-cert.pem std_data/server-key.pem
|
||||
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
|
||||
|
||||
INCLUDES = -I$(srcdir)/../include -I../include -I..
|
||||
|
19
mysql-test/include/show_msg.inc
Executable file
19
mysql-test/include/show_msg.inc
Executable file
@ -0,0 +1,19 @@
|
||||
#### include/show_msg.inc
|
||||
#
|
||||
# This file writes the value set in @message into the
|
||||
# a protocol file as part of executing a test sequence
|
||||
#
|
||||
# Usage:
|
||||
# Add the following to any *.test file:
|
||||
# :
|
||||
# set @message="This is a message example";
|
||||
# --source include/show_msg.inc
|
||||
# :
|
||||
#
|
||||
|
||||
--disable_query_log
|
||||
SET @utf8_message = CONVERT(@message using utf8);
|
||||
select @utf8_message as ""
|
||||
union
|
||||
select repeat(CONVERT('-' using utf8),char_length(@utf8_message));
|
||||
--enable_query_log
|
23
mysql-test/include/show_msg80.inc
Executable file
23
mysql-test/include/show_msg80.inc
Executable file
@ -0,0 +1,23 @@
|
||||
#### include/show_msg80.inc
|
||||
#
|
||||
# This file writes the value set in @message into the
|
||||
# a protocol file as part of executing a test sequence
|
||||
# with a dash line that is fixed on 80 characters.
|
||||
# This can be used in the case of long messages,
|
||||
# multi line messages that exceed 80 or if an 80 char
|
||||
# line is desired for short messages.
|
||||
#
|
||||
# Usage:
|
||||
# Add the following to any *.test file:
|
||||
# :
|
||||
# set @message="This is a message example";
|
||||
# --source include/show_msg80.inc
|
||||
# :
|
||||
#
|
||||
|
||||
--disable_query_log
|
||||
SET @utf8_message = CONVERT(@message using utf8);
|
||||
select @utf8_message as ""
|
||||
union
|
||||
select repeat(CONVERT('-' using utf8),80);
|
||||
--enable_query_log
|
@ -1806,11 +1806,12 @@ sub mysqld_arguments ($$$$$) {
|
||||
|
||||
if ( $opt_with_openssl )
|
||||
{
|
||||
mtr_add_arg($args, "%s--ssl-ca=%s/SSL/cacert.pem", $prefix, $glob_basedir);
|
||||
mtr_add_arg($args, "%s--ssl-cert=%s/SSL/server-cert.pem", $prefix,
|
||||
$glob_basedir);
|
||||
mtr_add_arg($args, "%s--ssl-key=%s/SSL/server-key.pem", $prefix,
|
||||
$glob_basedir);
|
||||
mtr_add_arg($args, "%s--ssl-ca=%s/std_data/cacert.pem", $prefix,
|
||||
$glob_mysql_test_dir);
|
||||
mtr_add_arg($args, "%s--ssl-cert=%s/std_data/server-cert.pem", $prefix,
|
||||
$glob_mysql_test_dir);
|
||||
mtr_add_arg($args, "%s--ssl-key=%s/std_data/server-key.pem", $prefix,
|
||||
$glob_mysql_test_dir);
|
||||
}
|
||||
|
||||
if ( $opt_warnings )
|
||||
@ -2148,9 +2149,12 @@ sub run_mysqltest ($$) {
|
||||
|
||||
if ( $opt_with_openssl )
|
||||
{
|
||||
mtr_add_arg($args, "--ssl-ca=%s/SSL/cacert.pem", $glob_basedir);
|
||||
mtr_add_arg($args, "--ssl-cert=%s/SSL/client-cert.pem", $glob_basedir);
|
||||
mtr_add_arg($args, "--ssl-key=%s/SSL/client-key.pem", $glob_basedir);
|
||||
mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem",
|
||||
$glob_mysql_test_dir);
|
||||
mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem",
|
||||
$glob_mysql_test_dir);
|
||||
mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem",
|
||||
$glob_mysql_test_dir);
|
||||
}
|
||||
|
||||
mtr_add_arg($args, "-R");
|
||||
|
@ -299,16 +299,16 @@ while test $# -gt 0; do
|
||||
--ndbcluster_port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster_port=;;"` ;;
|
||||
--with-openssl)
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT \
|
||||
--ssl-ca=$BASEDIR/SSL/cacert.pem \
|
||||
--ssl-cert=$BASEDIR/SSL/server-cert.pem \
|
||||
--ssl-key=$BASEDIR/SSL/server-key.pem"
|
||||
--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
|
||||
--ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem \
|
||||
--ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \
|
||||
--ssl-ca=$BASEDIR/SSL/cacert.pem \
|
||||
--ssl-cert=$BASEDIR/SSL/server-cert.pem \
|
||||
--ssl-key=$BASEDIR/SSL/server-key.pem"
|
||||
--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
|
||||
--ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem \
|
||||
--ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem"
|
||||
MYSQL_TEST_SSL_OPTS="--ssl-ca=$BASEDIR/SSL/cacert.pem \
|
||||
--ssl-cert=$BASEDIR/SSL/client-cert.pem \
|
||||
--ssl-key=$BASEDIR/SSL/client-key.pem" ;;
|
||||
--ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem \
|
||||
--ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem" ;;
|
||||
--no-manager | --skip-manager) USE_MANAGER=0 ;;
|
||||
--manager)
|
||||
USE_MANAGER=1
|
||||
@ -1793,6 +1793,11 @@ then
|
||||
$ECHO "Installing Test Databases"
|
||||
mysql_install_db
|
||||
|
||||
if [ -n "$1" -a `expr "X$*" : '.*ndb'` -eq 0 ]
|
||||
then
|
||||
USE_NDBCLUSTER=""
|
||||
fi
|
||||
|
||||
start_manager
|
||||
|
||||
# Do not automagically start daemons if we are in gdb or running only one test
|
||||
|
@ -1345,11 +1345,11 @@ void setup(char *file __attribute__((unused)))
|
||||
#endif /* HAVE_OPENSSL */
|
||||
|
||||
/* OpenSSL paths */
|
||||
snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir);
|
||||
snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir);
|
||||
snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir);
|
||||
snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir);
|
||||
snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir);
|
||||
snprintf(ca_cert, FN_REFLEN, "%s/std_data/cacert.pem", mysql_test_dir);
|
||||
snprintf(server_cert, FN_REFLEN, "%s/std_data/server-cert.pem", mysql_test_dir);
|
||||
snprintf(server_key, FN_REFLEN, "%s/std_data/server-key.pem", mysql_test_dir);
|
||||
snprintf(client_cert, FN_REFLEN, "%s/std_data/client-cert.pem", mysql_test_dir);
|
||||
snprintf(client_key, FN_REFLEN, "%s/std_data/client-key.pem", mysql_test_dir);
|
||||
|
||||
/* setup files */
|
||||
snprintf(mysqld_file, FN_REFLEN, "%s/mysqld", bin_dir);
|
||||
@ -1378,11 +1378,11 @@ void setup(char *file __attribute__((unused)))
|
||||
#endif /* HAVE_OPENSSL */
|
||||
|
||||
/* OpenSSL paths */
|
||||
snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir);
|
||||
snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir);
|
||||
snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir);
|
||||
snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir);
|
||||
snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir);
|
||||
snprintf(ca_cert, FN_REFLEN, "%s/std_data/cacert.pem", mysql_test_dir);
|
||||
snprintf(server_cert, FN_REFLEN, "%s/std_data/server-cert.pem", mysql_test_dir);
|
||||
snprintf(server_key, FN_REFLEN, "%s/std_data/server-key.pem", mysql_test_dir);
|
||||
snprintf(client_cert, FN_REFLEN, "%s/std_data/client-cert.pem", mysql_test_dir);
|
||||
snprintf(client_key, FN_REFLEN, "%s/std_data/client-key.pem", mysql_test_dir);
|
||||
|
||||
/* setup files */
|
||||
#ifdef _DEBUG
|
||||
@ -1411,11 +1411,11 @@ void setup(char *file __attribute__((unused)))
|
||||
#endif /* HAVE_OPENSSL */
|
||||
|
||||
/* OpenSSL paths */
|
||||
snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir);
|
||||
snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir);
|
||||
snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir);
|
||||
snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir);
|
||||
snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir);
|
||||
snprintf(ca_cert, FN_REFLEN, "%s/std_data/cacert.pem", mysql_test_dir);
|
||||
snprintf(server_cert, FN_REFLEN, "%s/std_data/server-cert.pem", mysql_test_dir);
|
||||
snprintf(server_key, FN_REFLEN, "%s/std_data/server-key.pem", mysql_test_dir);
|
||||
snprintf(client_cert, FN_REFLEN, "%s/std_data/client-cert.pem", mysql_test_dir);
|
||||
snprintf(client_key, FN_REFLEN, "%s/std_data/client-key.pem", mysql_test_dir);
|
||||
|
||||
/* setup files */
|
||||
snprintf(mysqld_file, FN_REFLEN, "%s/sql/mysqld", base_dir);
|
||||
|
32
mysql-test/r/analyze.result
Normal file
32
mysql-test/r/analyze.result
Normal file
@ -0,0 +1,32 @@
|
||||
create table t1 (a bigint);
|
||||
lock tables t1 write;
|
||||
insert into t1 values(0);
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
unlock tables;
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
create table t1 (a bigint);
|
||||
insert into t1 values(0);
|
||||
lock tables t1 write;
|
||||
delete from t1;
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
unlock tables;
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
create table t1 (a bigint);
|
||||
insert into t1 values(0);
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
@ -596,3 +596,9 @@ ERROR 42000: Incorrect database name 'xyz'
|
||||
create table t1(t1.name int);
|
||||
create table t2(test.t2.name int);
|
||||
drop table t1,t2;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
drop database mysqltest;
|
||||
create table test.t1 like x;
|
||||
ERROR 42000: Incorrect database name 'NULL'
|
||||
drop table if exists test.t1;
|
||||
|
@ -143,3 +143,6 @@ select format(col2,6) from t1 where col1=7;
|
||||
format(col2,6)
|
||||
1,234,567,890,123,456.123450
|
||||
drop table t1;
|
||||
select round(150, 2);
|
||||
round(150, 2)
|
||||
150.00
|
||||
|
@ -696,3 +696,8 @@ drop table t1;
|
||||
create table t1 (a int not null, b int not null auto_increment,
|
||||
primary key(a, b)) engine=heap;
|
||||
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
|
||||
create table t1 (c char(255), primary key(c(90)));
|
||||
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1
|
||||
drop table t1;
|
||||
|
@ -132,6 +132,22 @@ a b
|
||||
handler t2 read last;
|
||||
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 '' at line 1
|
||||
handler t2 close;
|
||||
handler t1 open;
|
||||
handler t1 read a next;
|
||||
a b
|
||||
14 aaa
|
||||
handler t1 read a next;
|
||||
a b
|
||||
15 bbb
|
||||
handler t1 close;
|
||||
handler t1 open;
|
||||
handler t1 read a prev;
|
||||
a b
|
||||
22 iii
|
||||
handler t1 read a prev;
|
||||
a b
|
||||
21 hhh
|
||||
handler t1 close;
|
||||
handler t1 open as t2;
|
||||
handler t2 read first;
|
||||
a b
|
||||
|
@ -329,3 +329,28 @@ ERROR 42S21: Duplicate column name 'c1'
|
||||
alter table t1 add key (c1,c1,c2);
|
||||
ERROR 42S21: Duplicate column name 'c1'
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10), b varchar(10), key(a(10),b(10)));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) default NULL,
|
||||
`b` varchar(10) default NULL,
|
||||
KEY `a` (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
alter table t1 modify b varchar(20);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) default NULL,
|
||||
`b` varchar(20) default NULL,
|
||||
KEY `a` (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
alter table t1 modify a varchar(20);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(20) default NULL,
|
||||
`b` varchar(20) default NULL,
|
||||
KEY `a` (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3;
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
DROP DATABASE IF EXISTS `TEST_$1`;
|
||||
DROP DATABASE IF EXISTS `test_$1`;
|
||||
CREATE TABLE T1 (a int);
|
||||
@ -159,3 +159,8 @@ select * from myUC;
|
||||
i
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
create table t2aA (col1 int);
|
||||
create table t1Aa (col1 int);
|
||||
select t1Aa.col1 from t1aA,t2Aa where t1Aa.col1 = t2aA.col1;
|
||||
col1
|
||||
drop table t2aA, t1Aa;
|
||||
|
@ -148,3 +148,17 @@ a'b a"b
|
||||
select 'aaa\\','aa''a',"aa""a";
|
||||
aaa\ aa'a aa"a
|
||||
aaa\ aa'a aa"a
|
||||
SET @message = 'Here comes a message';
|
||||
|
||||
Here comes a message
|
||||
--------------------
|
||||
SET @message = USER();
|
||||
|
||||
root@localhost
|
||||
--------------
|
||||
SET @message = 'Here comes a very very long message that is longer then 80 characters
|
||||
on multiple lines';
|
||||
|
||||
Here comes a very very long message that is longer then 80 characters
|
||||
on multiple lines
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -2682,3 +2682,20 @@ AND FK_firma_id = 2;
|
||||
COUNT(*)
|
||||
0
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int);
|
||||
CREATE TABLE t2 (a int);
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||
INSERT INTO t2 VALUES (2), (4), (6);
|
||||
SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a;
|
||||
a
|
||||
2
|
||||
4
|
||||
EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
|
||||
EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
|
||||
DROP TABLE t1,t2;
|
||||
|
@ -251,7 +251,7 @@ call sub1("sub1a", (select 7))|
|
||||
call sub1("sub1b", (select max(i) from t2))|
|
||||
call sub1("sub1c", (select i,d from t2 limit 1))|
|
||||
call sub1("sub1d", (select 1 from (select 1) a))|
|
||||
call sub2("sub2");
|
||||
call sub2("sub2")|
|
||||
select * from t1|
|
||||
id data
|
||||
sub1a 7
|
||||
@ -265,6 +265,7 @@ sub3((select max(i) from t2))
|
||||
drop procedure sub1|
|
||||
drop procedure sub2|
|
||||
drop function sub3|
|
||||
delete from t1|
|
||||
delete from t2|
|
||||
drop procedure if exists a0|
|
||||
create procedure a0(x int)
|
||||
@ -275,11 +276,6 @@ end while|
|
||||
call a0(3)|
|
||||
select * from t1|
|
||||
id data
|
||||
sub1a 7
|
||||
sub1b 3
|
||||
sub1c 1
|
||||
sub1d 1
|
||||
sub2 6
|
||||
a0 2
|
||||
a0 1
|
||||
a0 0
|
||||
|
@ -138,6 +138,8 @@ t1 CREATE TABLE `t1` (
|
||||
`min_num` decimal(7,6) default '0.000001'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1 ;
|
||||
set @@SQL_MODE=NULL;
|
||||
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL'
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='';
|
||||
show local variables like 'SQL_MODE';
|
||||
Variable_name Value
|
||||
|
@ -896,6 +896,14 @@ create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (2
|
||||
insert into t1 values(1,-1,-1);
|
||||
ERROR 22003: Out of range value adjusted for column 'd2' at row 1
|
||||
drop table t1;
|
||||
create table t1 (col1 decimal(5,2), col2 numeric(5,2));
|
||||
insert into t1 values (999.999,999.999);
|
||||
ERROR 22003: Out of range value adjusted for column 'col1' at row 1
|
||||
insert into t1 values (-999.999,-999.999);
|
||||
ERROR 22003: Out of range value adjusted for column 'col1' at row 1
|
||||
select * from t1;
|
||||
col1 col2
|
||||
drop table t1;
|
||||
set sql_mode='';
|
||||
set @sav_dpi= @@div_precision_increment;
|
||||
set @@div_precision_increment=15;
|
||||
|
@ -126,13 +126,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 258 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 258 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 258 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(256);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -150,13 +150,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 259 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 259 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 259 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(257);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -174,13 +174,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 260 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 260 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 260 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(258);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -198,13 +198,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 261 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 261 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 261 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(259);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -222,13 +222,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 262 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 262 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 262 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(258);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -246,13 +246,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 261 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 261 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 261 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(257);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -270,13 +270,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 260 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 260 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 260 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(256);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -294,13 +294,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 259 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 259 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 259 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(255);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -318,13 +318,13 @@ Some sample data
|
||||
Some samples
|
||||
explain select * from t1 where v like 'This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 3 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 258 NULL 3 Using where; Using index
|
||||
explain select * from t1 where v='This is a test' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 257 const 3 Using where
|
||||
1 SIMPLE t1 ref v v 258 const 3 Using where; Using index
|
||||
explain select * from t1 where v like 'S%' order by v;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 257 NULL 2 Using where; Using filesort
|
||||
1 SIMPLE t1 range v v 258 NULL 2 Using where; Using index
|
||||
alter table t1 change v v varchar(254);
|
||||
select * from t1 where v like 'This is a test' order by v;
|
||||
v
|
||||
@ -392,3 +392,26 @@ group by t1.b, t1.a;
|
||||
a b min(t1.b)
|
||||
22 NULL NULL
|
||||
drop table t1, t2;
|
||||
create table t1 (f1 varchar(65500));
|
||||
create index index1 on t1(f1(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` varchar(65500) default NULL,
|
||||
KEY `index1` (`f1`(10))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
alter table t1 modify f1 varchar(255);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` varchar(255) default NULL,
|
||||
KEY `index1` (`f1`(10))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
alter table t1 modify f1 tinytext;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` tinytext,
|
||||
KEY `index1` (`f1`(10))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
|
39
mysql-test/t/analyze.test
Normal file
39
mysql-test/t/analyze.test
Normal file
@ -0,0 +1,39 @@
|
||||
#
|
||||
# Bug #10901 Analyze Table on new table destroys table
|
||||
# This is minimal test case to get error
|
||||
# The problem was that analyze table wrote the shared state to the file and this
|
||||
# didn't include the inserts while locked. A check was needed to ensure that
|
||||
# state information was not updated when executing analyze table for a locked table.
|
||||
# The analyze table had to be within locks and check table had to be after unlocking
|
||||
# since then it brings the wrong state from disk rather than from the currently
|
||||
# correct internal state. The insert is needed since it changes the file state,
|
||||
# number of records.
|
||||
# The fix is to synchronise the state of the shared state and the current state before
|
||||
# calling mi_state_info_write
|
||||
#
|
||||
create table t1 (a bigint);
|
||||
lock tables t1 write;
|
||||
insert into t1 values(0);
|
||||
analyze table t1;
|
||||
unlock tables;
|
||||
check table t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a bigint);
|
||||
insert into t1 values(0);
|
||||
lock tables t1 write;
|
||||
delete from t1;
|
||||
analyze table t1;
|
||||
unlock tables;
|
||||
check table t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a bigint);
|
||||
insert into t1 values(0);
|
||||
analyze table t1;
|
||||
check table t1;
|
||||
|
||||
drop table t1;
|
||||
|
@ -503,3 +503,14 @@ create table t1(t1.name int);
|
||||
create table t2(test.t2.name int);
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug#11028: Crash on create table like
|
||||
#
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
drop database mysqltest;
|
||||
--error 1102
|
||||
create table test.t1 like x;
|
||||
--disable_warnings
|
||||
drop table if exists test.t1;
|
||||
--enable_warnings
|
||||
|
@ -79,3 +79,8 @@ insert into t1 values(7,1234567890123456.12345);
|
||||
select format(col2,6) from t1 where col1=7;
|
||||
drop table t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug #10083 (round doesn't increase decimals)
|
||||
#
|
||||
select round(150, 2);
|
||||
|
@ -426,3 +426,12 @@ drop table t1;
|
||||
--error 1075
|
||||
create table t1 (a int not null, b int not null auto_increment,
|
||||
primary key(a, b)) engine=heap;
|
||||
|
||||
#
|
||||
# Bug #10566: Verify that we can create a prefixed key with length > 255
|
||||
#
|
||||
create table t1 (c char(255), primary key(c(90)));
|
||||
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
--error 1062
|
||||
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
drop table t1;
|
||||
|
@ -69,6 +69,16 @@ handler t2 read next;
|
||||
handler t2 read last;
|
||||
handler t2 close;
|
||||
|
||||
handler t1 open;
|
||||
handler t1 read a next; # this used to crash as a bug#5373
|
||||
handler t1 read a next;
|
||||
handler t1 close;
|
||||
|
||||
handler t1 open;
|
||||
handler t1 read a prev; # this used to crash as a bug#5373
|
||||
handler t1 read a prev;
|
||||
handler t1 close;
|
||||
|
||||
handler t1 open as t2;
|
||||
handler t2 read first;
|
||||
alter table t1 engine=innodb;
|
||||
|
@ -324,3 +324,16 @@ alter table t1 add key (c1,c2,c1);
|
||||
--error 1060
|
||||
alter table t1 add key (c1,c1,c2);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# If we use a partial field for a key that is actually the length of the
|
||||
# field, and we extend the field, we end up with a key that includes the
|
||||
# whole new length of the field.
|
||||
#
|
||||
create table t1 (a varchar(10), b varchar(10), key(a(10),b(10)));
|
||||
show create table t1;
|
||||
alter table t1 modify b varchar(20);
|
||||
show create table t1;
|
||||
alter table t1 modify a varchar(20);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
@ -10,7 +10,7 @@ show variables like "lower_case_table_names";
|
||||
enable_query_log;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3;
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
DROP DATABASE IF EXISTS `TEST_$1`;
|
||||
DROP DATABASE IF EXISTS `test_$1`;
|
||||
--enable_warnings
|
||||
@ -128,3 +128,11 @@ create table myUC (i int);
|
||||
select * from myUC;
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
|
||||
#
|
||||
# Bug #9500: Problem with WHERE clause
|
||||
#
|
||||
create table t2aA (col1 int);
|
||||
create table t1Aa (col1 int);
|
||||
select t1Aa.col1 from t1aA,t2Aa where t1Aa.col1 = t2aA.col1;
|
||||
drop table t2aA, t1Aa;
|
||||
|
@ -295,3 +295,23 @@ select 1 as `a'b`, 2 as `a"b`;
|
||||
|
||||
# Test escaping of quotes
|
||||
select 'aaa\\','aa''a',"aa""a";
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Check of include/show_msg.inc
|
||||
#
|
||||
|
||||
# The message contains in most cases a string with the default character set
|
||||
SET @message = 'Here comes a message';
|
||||
--source include/show_msg.inc
|
||||
|
||||
# The message could also contain a string with character set utf8
|
||||
SET @message = USER();
|
||||
--source include/show_msg.inc
|
||||
|
||||
# The message contains more then 80 characters on multiple lines
|
||||
SET @message = 'Here comes a very very long message that is longer then 80 characters
|
||||
on multiple lines';
|
||||
--source include/show_msg80.inc
|
||||
|
||||
|
@ -2255,3 +2255,19 @@ AND FK_firma_id = 2;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test for bug #10084: STRAIGHT_JOIN with ON expression
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int);
|
||||
CREATE TABLE t2 (a int);
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||
INSERT INTO t2 VALUES (2), (4), (6);
|
||||
|
||||
SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a;
|
||||
|
||||
EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a;
|
||||
EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
@ -372,12 +372,13 @@ call sub1("sub1a", (select 7))|
|
||||
call sub1("sub1b", (select max(i) from t2))|
|
||||
call sub1("sub1c", (select i,d from t2 limit 1))|
|
||||
call sub1("sub1d", (select 1 from (select 1) a))|
|
||||
call sub2("sub2");
|
||||
call sub2("sub2")|
|
||||
select * from t1|
|
||||
select sub3((select max(i) from t2))|
|
||||
drop procedure sub1|
|
||||
drop procedure sub2|
|
||||
drop function sub3|
|
||||
delete from t1|
|
||||
delete from t2|
|
||||
|
||||
# Basic tests of the flow control constructs
|
||||
|
@ -80,6 +80,11 @@ create table t1 ( min_num dec(6,6) default .000001);
|
||||
show create table t1;
|
||||
drop table t1 ;
|
||||
|
||||
#
|
||||
# Bug #10732: Set SQL_MODE to NULL gives garbled error message
|
||||
#
|
||||
--error 1231
|
||||
set @@SQL_MODE=NULL;
|
||||
|
||||
#
|
||||
# test for
|
||||
|
@ -934,6 +934,13 @@ create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (2
|
||||
--error 1264
|
||||
insert into t1 values(1,-1,-1);
|
||||
drop table t1;
|
||||
create table t1 (col1 decimal(5,2), col2 numeric(5,2));
|
||||
--error 1264
|
||||
insert into t1 values (999.999,999.999);
|
||||
--error 1264
|
||||
insert into t1 values (-999.999,-999.999);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
set sql_mode='';
|
||||
|
||||
#
|
||||
|
@ -118,3 +118,15 @@ insert into t2 values (22), (22);
|
||||
select t1.a, t1.b, min(t1.b) from t1 inner join t2 ON t2.a = t1.a
|
||||
group by t1.b, t1.a;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug #10543: convert varchar with index to text
|
||||
#
|
||||
create table t1 (f1 varchar(65500));
|
||||
create index index1 on t1(f1(10));
|
||||
show create table t1;
|
||||
alter table t1 modify f1 varchar(255);
|
||||
show create table t1;
|
||||
alter table t1 modify f1 tinytext;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user