mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1
into pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build client/mysqldump.c: Auto merged mysql-test/r/innodb_mysql.result: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged
This commit is contained in:
@ -1069,6 +1069,15 @@ DROP TABLE t1;
|
||||
|
||||
###########################################################################
|
||||
|
||||
#
|
||||
# Bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0
|
||||
#
|
||||
create table t1(a char(10) not null, unique key aa(a(1)),
|
||||
b char(4) not null, unique key bb(b(4))) engine=innodb;
|
||||
desc t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
|
||||
@ -1353,4 +1362,12 @@ if ($test_foreign_keys)
|
||||
DROP TABLE t1;
|
||||
}
|
||||
|
||||
#
|
||||
# Bug #26447: "ALTER TABLE .. ORDER" does not work with InnoDB and
|
||||
# auto_increment keys
|
||||
#
|
||||
create table t1 (a int auto_increment primary key) engine=innodb;
|
||||
alter table t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -33,16 +33,14 @@ my $skip_test;
|
||||
|
||||
sub init_pattern {
|
||||
my ($from, $what)= @_;
|
||||
if ( $from =~ /[a-z0-9]/ ) {
|
||||
if ( $from =~ /^[a-z0-9]$/ ) {
|
||||
# Does not contain any regex, make the pattern match
|
||||
# beginning of string
|
||||
$from= "^$from";
|
||||
}
|
||||
else {
|
||||
# Check that pattern is a valid regex
|
||||
eval { "" =~/$from/; 1 } or
|
||||
mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@");
|
||||
}
|
||||
# Check that pattern is a valid regex
|
||||
eval { "" =~/$from/; 1 } or
|
||||
mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@");
|
||||
return $from;
|
||||
}
|
||||
|
||||
|
@ -257,13 +257,13 @@ our $opt_timer= 1;
|
||||
|
||||
our $opt_user;
|
||||
|
||||
our $opt_valgrind= 0;
|
||||
our $opt_valgrind_mysqld= 0;
|
||||
our $opt_valgrind_mysqltest= 0;
|
||||
our $default_valgrind_options= "--show-reachable=yes";
|
||||
our $opt_valgrind_options;
|
||||
our $opt_valgrind_path;
|
||||
our $opt_callgrind;
|
||||
my $opt_valgrind= 0;
|
||||
my $opt_valgrind_mysqld= 0;
|
||||
my $opt_valgrind_mysqltest= 0;
|
||||
my @default_valgrind_args= ("--show-reachable=yes");
|
||||
my @valgrind_args;
|
||||
my $opt_valgrind_path;
|
||||
my $opt_callgrind;
|
||||
|
||||
our $opt_stress= "";
|
||||
our $opt_stress_suite= "main";
|
||||
@ -463,6 +463,19 @@ sub main () {
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
#
|
||||
# When an option is no longer used by this program, it must be explicitly
|
||||
# ignored or else it will be passed through to mysqld. GetOptions will call
|
||||
# this subroutine once for each such option on the command line. See
|
||||
# Getopt::Long documentation.
|
||||
#
|
||||
|
||||
sub warn_about_removed_option {
|
||||
my ($option, $value, $hash_value) = @_;
|
||||
|
||||
warn "WARNING: This option is no longer used, and is ignored: --$option\n";
|
||||
}
|
||||
|
||||
sub command_line_setup () {
|
||||
|
||||
# These are defaults for things that are set on the command line
|
||||
@ -499,6 +512,15 @@ sub command_line_setup () {
|
||||
# Read the command line
|
||||
# Note: Keep list, and the order, in sync with usage at end of this file
|
||||
|
||||
# Options that are no longer used must still be processed, because all
|
||||
# unprocessed options are passed directly to mysqld. The user will be
|
||||
# warned that the option is being ignored.
|
||||
#
|
||||
# Put the complete option string here. For example, to remove the --suite
|
||||
# option, remove it from GetOptions() below and put 'suite|suites=s' here.
|
||||
my @removed_options = (
|
||||
);
|
||||
|
||||
Getopt::Long::Configure("pass_through");
|
||||
GetOptions(
|
||||
# Control what engine/variation to run
|
||||
@ -577,7 +599,18 @@ sub command_line_setup () {
|
||||
'valgrind|valgrind-all' => \$opt_valgrind,
|
||||
'valgrind-mysqltest' => \$opt_valgrind_mysqltest,
|
||||
'valgrind-mysqld' => \$opt_valgrind_mysqld,
|
||||
'valgrind-options=s' => \$opt_valgrind_options,
|
||||
'valgrind-options=s' => sub {
|
||||
my ($opt, $value)= @_;
|
||||
# Deprecated option unless it's what we know pushbuild uses
|
||||
if ($value eq "--gen-suppressions=all --show-reachable=yes") {
|
||||
push(@valgrind_args, $_) for (split(' ', $value));
|
||||
return;
|
||||
}
|
||||
die("--valgrind-options=s is deprecated. Use ",
|
||||
"--valgrind-option=s, to be specified several",
|
||||
" times if necessary");
|
||||
},
|
||||
'valgrind-option=s' => \@valgrind_args,
|
||||
'valgrind-path=s' => \$opt_valgrind_path,
|
||||
'callgrind' => \$opt_callgrind,
|
||||
|
||||
@ -617,6 +650,9 @@ sub command_line_setup () {
|
||||
'suite-timeout=i' => \$opt_suite_timeout,
|
||||
'warnings|log-warnings' => \$opt_warnings,
|
||||
|
||||
# Options which are no longer used
|
||||
(map { $_ => \&warn_about_removed_option } @removed_options),
|
||||
|
||||
'help|h' => \$opt_usage,
|
||||
) or usage("Can't read options");
|
||||
|
||||
@ -980,7 +1016,7 @@ sub command_line_setup () {
|
||||
# --------------------------------------------------------------------------
|
||||
# Check valgrind arguments
|
||||
# --------------------------------------------------------------------------
|
||||
if ( $opt_valgrind or $opt_valgrind_path or defined $opt_valgrind_options)
|
||||
if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args)
|
||||
{
|
||||
mtr_report("Turning on valgrind for all executables");
|
||||
$opt_valgrind= 1;
|
||||
@ -1005,17 +1041,18 @@ sub command_line_setup () {
|
||||
$opt_valgrind_mysqld= 1;
|
||||
|
||||
# Set special valgrind options unless options passed on command line
|
||||
$opt_valgrind_options="--trace-children=yes"
|
||||
unless defined $opt_valgrind_options;
|
||||
push(@valgrind_args, "--trace-children=yes")
|
||||
unless @valgrind_args;
|
||||
}
|
||||
|
||||
if ( $opt_valgrind )
|
||||
{
|
||||
# Set valgrind_options to default unless already defined
|
||||
$opt_valgrind_options=$default_valgrind_options
|
||||
unless defined $opt_valgrind_options;
|
||||
push(@valgrind_args, @default_valgrind_args)
|
||||
unless @valgrind_args;
|
||||
|
||||
mtr_report("Running valgrind with options \"$opt_valgrind_options\"");
|
||||
mtr_report("Running valgrind with options \"",
|
||||
join(" ", @valgrind_args), "\"");
|
||||
}
|
||||
|
||||
if ( ! $opt_testcase_timeout )
|
||||
@ -3770,6 +3807,7 @@ sub mysqld_arguments ($$$$) {
|
||||
# see BUG#28359
|
||||
mtr_add_arg($args, "%s--connect-timeout=60", $prefix);
|
||||
|
||||
|
||||
# When mysqld is run by a root user(euid is 0), it will fail
|
||||
# to start unless we specify what user to run as. If not running
|
||||
# as root it will be ignored, see BUG#30630
|
||||
@ -5075,7 +5113,7 @@ sub valgrind_arguments {
|
||||
}
|
||||
|
||||
# Add valgrind options, can be overriden by user
|
||||
mtr_add_arg($args, '%s', $opt_valgrind_options);
|
||||
mtr_add_arg($args, '%s', $_) for (@valgrind_args);
|
||||
|
||||
mtr_add_arg($args, $$exe);
|
||||
|
||||
@ -5219,12 +5257,14 @@ Options for coverage, profiling etc
|
||||
gcov FIXME
|
||||
gprof FIXME
|
||||
valgrind Run the "mysqltest" and "mysqld" executables using
|
||||
valgrind with options($default_valgrind_options)
|
||||
valgrind with default options
|
||||
valgrind-all Synonym for --valgrind
|
||||
valgrind-mysqltest Run the "mysqltest" and "mysql_client_test" executable
|
||||
with valgrind
|
||||
valgrind-mysqld Run the "mysqld" executable with valgrind
|
||||
valgrind-options=ARGS Options to give valgrind, replaces default options
|
||||
valgrind-options=ARGS Deprecated, use --valgrind-option
|
||||
valgrind-option=ARGS Option to give valgrind, replaces default option(s),
|
||||
can be specified more then once
|
||||
valgrind-path=[EXE] Path to the valgrind executable
|
||||
callgrind Instruct valgrind to use callgrind
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
drop table if exists t1,t2;
|
||||
drop table if exists t1, t2;
|
||||
select CASE "b" when "a" then 1 when "b" then 2 END;
|
||||
CASE "b" when "a" then 1 when "b" then 2 END
|
||||
2
|
||||
@ -200,3 +200,21 @@ CEMPNUM EMPMUM1 EMPNUM2
|
||||
0.00 0 0.00
|
||||
2.00 2 NULL
|
||||
DROP TABLE t1,t2;
|
||||
End of 4.1 tests
|
||||
create table t1 (a int, b bigint unsigned);
|
||||
create table t2 (c int);
|
||||
insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997),
|
||||
(3,11120436154190595086);
|
||||
insert into t2 (c) values (1), (2), (3);
|
||||
select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
|
||||
join t2 on t1.a=t2.c order by d;
|
||||
a d
|
||||
1 4572794622775114594
|
||||
3 11120436154190595086
|
||||
2 18196094287899841997
|
||||
select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
|
||||
join t2 on t1.a=t2.c where b=11120436154190595086 order by d;
|
||||
a d
|
||||
3 11120436154190595086
|
||||
drop table t1, t2;
|
||||
End of 5.0 tests
|
||||
|
@ -811,6 +811,14 @@ quote(name)
|
||||
????????
|
||||
????????????????
|
||||
drop table bug20536;
|
||||
set names ucs2;
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
|
||||
set names ucs2 collate ucs2_bin;
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
|
||||
set character_set_client= ucs2;
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
|
||||
set character_set_client= concat('ucs', substr('2', 1));
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
|
||||
CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci);
|
||||
INSERT INTO t1 VALUES('abcd');
|
||||
SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE);
|
||||
|
@ -212,6 +212,12 @@ test
|
||||
SELECT NAME_CONST('test', 'test');
|
||||
test
|
||||
test
|
||||
create table t1 (a int not null);
|
||||
insert into t1 values (-1), (-2);
|
||||
select min(a) from t1 group by inet_ntoa(a);
|
||||
min(a)
|
||||
-2
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
select connection_id() > 0;
|
||||
connection_id() > 0
|
||||
|
@ -1194,6 +1194,7 @@ ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table '
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP DATABASE mysqltest2;
|
||||
DROP USER mysqltest_1@localhost;
|
||||
DROP USER mysqltest_2@localhost;
|
||||
use test;
|
||||
CREATE TABLE t1 (f1 int, f2 int);
|
||||
INSERT INTO t1 VALUES(1,1), (2,2);
|
||||
@ -1213,6 +1214,7 @@ f1 f2
|
||||
REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost';
|
||||
REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
|
||||
REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
|
||||
DROP USER mysqltest_1@localhost;
|
||||
DROP DATABASE db27878;
|
||||
use test;
|
||||
DROP TABLE t1;
|
||||
@ -1226,6 +1228,44 @@ drop user юзер_юзер@localhost;
|
||||
grant select on test.* to очень_длинный_юзер@localhost;
|
||||
ERROR HY000: String 'очень_длинный_юзер' is too long for user name (should be no longer than 16)
|
||||
set names default;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
grant create on mysqltest.* to mysqltest@localhost;
|
||||
create table t1 (i INT);
|
||||
insert into t1 values (1);
|
||||
ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1'
|
||||
create table t2 (i INT);
|
||||
create table t4 (i INT);
|
||||
grant select, insert on mysqltest.t2 to mysqltest@localhost;
|
||||
grant insert on mysqltest.t4 to mysqltest@localhost;
|
||||
grant create, insert on mysqltest.t5 to mysqltest@localhost;
|
||||
grant create, insert on mysqltest.t6 to mysqltest@localhost;
|
||||
flush privileges;
|
||||
insert into t2 values (1);
|
||||
create table if not exists t1 select * from t2;
|
||||
ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1'
|
||||
create table if not exists t3 select * from t2;
|
||||
ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't3'
|
||||
create table if not exists t4 select * from t2;
|
||||
Warnings:
|
||||
Note 1050 Table 't4' already exists
|
||||
create table if not exists t5 select * from t2;
|
||||
create table t6 select * from t2;
|
||||
create table t7 select * from t2;
|
||||
ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't7'
|
||||
create table t4 select * from t2;
|
||||
ERROR 42S01: Table 't4' already exists
|
||||
create table t1 select * from t2;
|
||||
ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1'
|
||||
drop table t1,t2,t4,t5,t6;
|
||||
revoke create on mysqltest.* from mysqltest@localhost;
|
||||
revoke select, insert on mysqltest.t2 from mysqltest@localhost;
|
||||
revoke insert on mysqltest.t4 from mysqltest@localhost;
|
||||
revoke create, insert on mysqltest.t5 from mysqltest@localhost;
|
||||
revoke create, insert on mysqltest.t6 from mysqltest@localhost;
|
||||
drop user mysqltest@localhost;
|
||||
drop database mysqltest;
|
||||
use test;
|
||||
FLUSH PRIVILEGES without procs_priv table.
|
||||
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
|
||||
FLUSH PRIVILEGES;
|
||||
@ -1245,3 +1285,4 @@ CALL mysqltest1.test();
|
||||
DROP DATABASE mysqltest1;
|
||||
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
|
||||
FLUSH PRIVILEGES;
|
||||
End of 5.1 tests
|
||||
|
@ -925,7 +925,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL b 4 NULL # Using index
|
||||
explain select a,b from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL b 4 NULL # Using index
|
||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL #
|
||||
explain select a,b,c from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL #
|
||||
@ -1153,14 +1153,14 @@ UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
|
||||
SELECT * from t1;
|
||||
a b
|
||||
1 1
|
||||
102 2
|
||||
103 3
|
||||
4 4
|
||||
5 5
|
||||
6 6
|
||||
7 7
|
||||
8 8
|
||||
9 9
|
||||
102 2
|
||||
103 3
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb;
|
||||
CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb;
|
||||
@ -1184,7 +1184,6 @@ a b
|
||||
update t1,t2 set t1.a=t1.a+100 where t1.a=101;
|
||||
select * from t1;
|
||||
a b
|
||||
201 1
|
||||
102 2
|
||||
103 3
|
||||
104 4
|
||||
@ -1196,10 +1195,11 @@ a b
|
||||
110 10
|
||||
111 11
|
||||
112 12
|
||||
201 1
|
||||
update t1,t2 set t1.b=t1.b+10 where t1.b=2;
|
||||
select * from t1;
|
||||
a b
|
||||
201 1
|
||||
102 12
|
||||
103 3
|
||||
104 4
|
||||
105 5
|
||||
@ -1209,34 +1209,34 @@ a b
|
||||
109 9
|
||||
110 10
|
||||
111 11
|
||||
102 12
|
||||
112 12
|
||||
201 1
|
||||
update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100;
|
||||
select * from t1;
|
||||
a b
|
||||
201 1
|
||||
102 12
|
||||
103 5
|
||||
104 6
|
||||
106 6
|
||||
105 7
|
||||
106 6
|
||||
107 7
|
||||
108 8
|
||||
109 9
|
||||
110 10
|
||||
111 11
|
||||
102 12
|
||||
112 12
|
||||
201 1
|
||||
select * from t2;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 13
|
||||
4 14
|
||||
5 15
|
||||
6 6
|
||||
7 7
|
||||
8 8
|
||||
9 9
|
||||
3 13
|
||||
4 14
|
||||
5 15
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM;
|
||||
CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
||||
@ -1287,11 +1287,11 @@ insert into t1 (id) values (null),(null),(null),(null),(null);
|
||||
update t1 set fk=69 where fk is null order by id limit 1;
|
||||
SELECT * from t1;
|
||||
id fk
|
||||
1 69
|
||||
2 NULL
|
||||
3 NULL
|
||||
4 NULL
|
||||
5 NULL
|
||||
1 69
|
||||
drop table t1;
|
||||
create table t1 (a int not null, b int not null, key (a));
|
||||
insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3);
|
||||
@ -2420,8 +2420,8 @@ insert into t1 (b) values (1);
|
||||
replace into t1 (b) values (2), (1), (3);
|
||||
select * from t1;
|
||||
a b
|
||||
3 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
truncate table t1;
|
||||
insert into t1 (b) values (1);
|
||||
@ -2430,8 +2430,8 @@ replace into t1 (b) values (1);
|
||||
replace into t1 (b) values (3);
|
||||
select * from t1;
|
||||
a b
|
||||
3 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
drop table t1;
|
||||
create table t1 (rowid int not null auto_increment, val int not null,primary
|
||||
|
@ -355,13 +355,13 @@ EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
|
||||
1 SIMPLE t1 index PRIMARY,name PRIMARY 4 NULL 3 Using where
|
||||
1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%' OR FALSE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
|
||||
1 SIMPLE t2 index NULL PRIMARY 4 NULL 5
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
@ -1266,11 +1266,11 @@ select_type SIMPLE
|
||||
table t1
|
||||
type index
|
||||
possible_keys NULL
|
||||
key b
|
||||
key_len 5
|
||||
key PRIMARY
|
||||
key_len 4
|
||||
ref NULL
|
||||
rows 3
|
||||
Extra Using index; Using filesort
|
||||
Extra Using filesort
|
||||
SELECT * FROM t1 ORDER BY b ASC, a DESC;
|
||||
a b
|
||||
1 1
|
||||
@ -1282,11 +1282,11 @@ select_type SIMPLE
|
||||
table t1
|
||||
type index
|
||||
possible_keys NULL
|
||||
key b
|
||||
key_len 5
|
||||
key PRIMARY
|
||||
key_len 4
|
||||
ref NULL
|
||||
rows 3
|
||||
Extra Using index; Using filesort
|
||||
Extra Using filesort
|
||||
SELECT * FROM t1 ORDER BY b DESC, a ASC;
|
||||
a b
|
||||
2 2
|
||||
@ -1327,6 +1327,21 @@ test t1 Redundant
|
||||
# - that's it, cleanup.
|
||||
|
||||
DROP TABLE t1;
|
||||
create table t1(a char(10) not null, unique key aa(a(1)),
|
||||
b char(4) not null, unique key bb(b(4))) engine=innodb;
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
a char(10) NO UNI NULL
|
||||
b char(4) NO PRI NULL
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(10) NOT NULL,
|
||||
`b` char(4) NOT NULL,
|
||||
UNIQUE KEY `bb` (`b`),
|
||||
UNIQUE KEY `aa` (`a`(1))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE `t2` (
|
||||
`k` int(11) NOT NULL auto_increment,
|
||||
@ -1575,4 +1590,9 @@ t2 CREATE TABLE `t2` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int auto_increment primary key) engine=innodb;
|
||||
alter table t1 order by a;
|
||||
Warnings:
|
||||
Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1'
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
@ -499,4 +499,138 @@ i
|
||||
2
|
||||
2
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
a char(20) NOT NULL,
|
||||
b char(7) DEFAULT NULL,
|
||||
c char(4) DEFAULT NULL
|
||||
);
|
||||
INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0);
|
||||
INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01);
|
||||
INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15);
|
||||
INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
|
||||
INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
|
||||
INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
9.999999 10 10
|
||||
1.225e-05 1.2e-05 1e-0
|
||||
0.0001225 0.00012 NULL
|
||||
0.1225 0.1225 NULL
|
||||
0.1225877 0.12259 NULL
|
||||
12.25 12.25 NULL
|
||||
12.25 12.25 12.2
|
||||
122500 122500 NULL
|
||||
12250000000 1.2e+10 NULL
|
||||
1.225e+15 1.2e+15 NULL
|
||||
5000000 5000000 NULL
|
||||
1.25e+78 1.2e+78 NULL
|
||||
1.25e-94 1.2e-94 NULL
|
||||
1.25e+203 1e+203 NULL
|
||||
1.25e-175 1e-175 NULL
|
||||
1.225 NULL 1.23
|
||||
1.37 NULL 1.37
|
||||
-1.37 NULL -1.3
|
||||
0.00187 NULL 0.00
|
||||
-0.0187 NULL -0.0
|
||||
5000 NULL 5000
|
||||
-5000 NULL -500
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
a char(20) NOT NULL,
|
||||
b char(7) DEFAULT NULL,
|
||||
c char(5)
|
||||
);
|
||||
INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0);
|
||||
INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01);
|
||||
INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15);
|
||||
INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
|
||||
INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
|
||||
INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
|
||||
INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
|
||||
INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
9.999999 10 9.999
|
||||
1.225e-05 1.2e-05 1e-05
|
||||
0.0001225 0.00012 NULL
|
||||
0.1225 0.1225 NULL
|
||||
0.1225877 0.12259 NULL
|
||||
12.25 12.25 NULL
|
||||
12.25 12.25 12.25
|
||||
122500 122500 NULL
|
||||
12250000000 1.2e+10 NULL
|
||||
1.225e+15 1.2e+15 NULL
|
||||
5000000 5000000 NULL
|
||||
1.25e+78 1.2e+78 NULL
|
||||
1.25e-94 1.2e-94 NULL
|
||||
1.25e+203 1e+203 NULL
|
||||
1.25e-175 1e-175 NULL
|
||||
1.225 NULL 1.225
|
||||
1.37 NULL 1.37
|
||||
-1.37 NULL -1.37
|
||||
0.00187 NULL 0.002
|
||||
-0.0187 NULL -0.01
|
||||
5000 NULL 5000
|
||||
-5000 NULL -5000
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t (a CHAR(10),b INT);
|
||||
INSERT INTO t VALUES (),(),();
|
||||
INSERT INTO t(a) SELECT rand() FROM t;
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t1 (c1 INT NOT NULL);
|
||||
INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500),
|
||||
('4188.32999999999992724042385816574096679687500'), (4188);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
4188
|
||||
4188
|
||||
4188
|
||||
CREATE TABLE t2 (c1 BIGINT);
|
||||
INSERT INTO t2 VALUES('15449237462.0000000000');
|
||||
SELECT * FROM t2;
|
||||
c1
|
||||
15449237462
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests.
|
||||
|
@ -8,12 +8,12 @@ EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
|
||||
1 SIMPLE t1 index PRIMARY,name PRIMARY 4 NULL 3 Using where
|
||||
1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%' OR FALSE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
|
||||
1 SIMPLE t2 index NULL PRIMARY 4 NULL 5
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
|
||||
DROP TABLE t1,t2;
|
||||
|
@ -530,6 +530,51 @@ ORDER BY c.b, c.d
|
||||
a b c d e f g h i j a b c d
|
||||
2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL
|
||||
DROP TABLE t1, t2;
|
||||
create table t1(a int not null, key aa(a),
|
||||
b char(10) not null, unique key bb(b(1)),
|
||||
c char(4) not null, unique key cc(c));
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO MUL NULL
|
||||
b char(10) NO UNI NULL
|
||||
c char(4) NO PRI NULL
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL,
|
||||
`b` char(10) NOT NULL,
|
||||
`c` char(4) NOT NULL,
|
||||
UNIQUE KEY `cc` (`c`),
|
||||
UNIQUE KEY `bb` (`b`(1)),
|
||||
KEY `aa` (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1(a int not null, key aa(a),
|
||||
b char(10) not null, unique key bb(b(1)),
|
||||
c char(4) not null);
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO MUL NULL
|
||||
b char(10) NO UNI NULL
|
||||
c char(4) NO NULL
|
||||
alter table t1 add unique key cc(c);
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO MUL NULL
|
||||
b char(10) NO UNI NULL
|
||||
c char(4) NO PRI NULL
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL,
|
||||
`b` char(10) NOT NULL,
|
||||
`c` char(4) NOT NULL,
|
||||
UNIQUE KEY `cc` (`c`),
|
||||
UNIQUE KEY `bb` (`b`(1)),
|
||||
KEY `aa` (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT);
|
||||
INSERT INTO t1 VALUES (), (), ();
|
||||
|
@ -237,4 +237,16 @@ SELECT @@slow_query_log, @@log_slow_queries;
|
||||
1 1
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||
set @old_general_log_file= @@global.general_log_file;
|
||||
set @old_slow_query_log_file= @@global.slow_query_log_file;
|
||||
set global general_log_file= concat('/not exiting path/log.maste', 'r');
|
||||
ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
|
||||
set global general_log_file= NULL;
|
||||
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'NULL'
|
||||
set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
|
||||
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not exiting path/log.master'
|
||||
set global slow_query_log_file= NULL;
|
||||
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'NULL'
|
||||
set global general_log_file= @old_general_log_file;
|
||||
set global slow_query_log_file= @old_slow_query_log_file;
|
||||
End of 5.1 tests
|
||||
|
@ -1,4 +1,4 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
|
||||
drop view if exists v1;
|
||||
drop database if exists client_test_db;
|
||||
mysql.columns_priv OK
|
||||
@ -57,4 +57,27 @@ test.t1 OK
|
||||
test.t1 OK
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create table `t``1`(a int);
|
||||
create table `t 1`(a int);
|
||||
test.t 1 OK
|
||||
test.t`1 OK
|
||||
drop table `t``1`, `t 1`;
|
||||
End of 5.0 tests
|
||||
create table t1(a int);
|
||||
create view v1 as select * from t1;
|
||||
show tables;
|
||||
Tables_in_test
|
||||
t1
|
||||
v1
|
||||
show tables;
|
||||
Tables_in_test
|
||||
t1
|
||||
#mysql50#v-1
|
||||
v1
|
||||
show tables;
|
||||
Tables_in_test
|
||||
t1
|
||||
v1
|
||||
v-1
|
||||
drop view v1, `v-1`;
|
||||
drop table t1;
|
||||
|
@ -1143,6 +1143,11 @@ a
|
||||
13
|
||||
DEALLOCATE PREPARE st1;
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int, b tinyint);
|
||||
prepare st1 from 'update t1 set b= (str_to_date(a, a))';
|
||||
execute st1;
|
||||
deallocate prepare st1;
|
||||
drop table t1;
|
||||
End of 4.1 tests.
|
||||
create table t1 (a varchar(20));
|
||||
insert into t1 values ('foo');
|
||||
|
@ -8,6 +8,8 @@ VARIABLE_NAME VARIABLE_VALUE
|
||||
TABLE_LOCKS_IMMEDIATE 2
|
||||
TABLE_LOCKS_WAITED 0
|
||||
SET SQL_LOG_BIN=0;
|
||||
set @old_general_log = @@global.general_log;
|
||||
set global general_log = 'OFF';
|
||||
drop table if exists t1;
|
||||
create table t1(n int) engine=myisam;
|
||||
insert into t1 values(1);
|
||||
@ -20,6 +22,7 @@ show status like 'Table_locks_waited';
|
||||
Variable_name Value
|
||||
Table_locks_waited 1
|
||||
drop table t1;
|
||||
set global general_log = @old_general_log;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
|
@ -1509,6 +1509,26 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 decimal(31,30) NO 0.000000000000000000000000000000
|
||||
SELECT f1 FROM t1;
|
||||
f1
|
||||
0.123456789012345678901234567890
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'f1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 decimal(59,30) NO 0.000000000000000000000000000000
|
||||
SELECT f1 FROM t1;
|
||||
f1
|
||||
99999999999999999999999999999.999999999999999999999999999999
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
select cast(143.481 as decimal(4,1));
|
||||
cast(143.481 as decimal(4,1))
|
||||
|
@ -81,6 +81,16 @@ if (`select $slave_count != $master_count`)
|
||||
echo master and slave differed in number of rows;
|
||||
echo master: $master_count;
|
||||
echo slave: $slave_count;
|
||||
|
||||
connection master;
|
||||
echo === master ===;
|
||||
select count(*) t1;
|
||||
select * from t1;
|
||||
connection slave;
|
||||
echo === slave ===;
|
||||
select count(*) t1;
|
||||
select * from t1;
|
||||
query_vertical show slave status;
|
||||
}
|
||||
|
||||
connection master;
|
||||
|
@ -1,9 +1,9 @@
|
||||
#
|
||||
|
||||
# Testing of CASE
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
select CASE "b" when "a" then 1 when "b" then 2 END;
|
||||
@ -152,4 +152,21 @@ SELECT IFNULL(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM,
|
||||
FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
# End of 4.1 tests
|
||||
|
||||
--echo End of 4.1 tests
|
||||
|
||||
#
|
||||
# #30782: Truncated UNSIGNED BIGINT columns
|
||||
#
|
||||
create table t1 (a int, b bigint unsigned);
|
||||
create table t2 (c int);
|
||||
insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997),
|
||||
(3,11120436154190595086);
|
||||
insert into t2 (c) values (1), (2), (3);
|
||||
select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
|
||||
join t2 on t1.a=t2.c order by d;
|
||||
select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
|
||||
join t2 on t1.a=t2.c where b=11120436154190595086 order by d;
|
||||
drop table t1, t2;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -547,6 +547,18 @@ select quote(name) from bug20536;
|
||||
|
||||
drop table bug20536;
|
||||
|
||||
#
|
||||
# Bug #31615: crash after set names ucs2 collate xxx
|
||||
#
|
||||
--error 1231
|
||||
set names ucs2;
|
||||
--error 1231
|
||||
set names ucs2 collate ucs2_bin;
|
||||
--error 1231
|
||||
set character_set_client= ucs2;
|
||||
--error 1231
|
||||
set character_set_client= concat('ucs', substr('2', 1));
|
||||
|
||||
#
|
||||
# BUG#31159 - fulltext search on ucs2 column crashes server
|
||||
#
|
||||
|
@ -213,6 +213,14 @@ SELECT NAME_CONST('test', 1.0);
|
||||
SELECT NAME_CONST('test', -1.0);
|
||||
SELECT NAME_CONST('test', 'test');
|
||||
|
||||
#
|
||||
# Bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
|
||||
#
|
||||
create table t1 (a int not null);
|
||||
insert into t1 values (-1), (-2);
|
||||
select min(a) from t1 group by inet_ntoa(a);
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
@ -1235,6 +1235,7 @@ DROP DATABASE mysqltest1;
|
||||
DROP DATABASE mysqltest2;
|
||||
|
||||
DROP USER mysqltest_1@localhost;
|
||||
DROP USER mysqltest_2@localhost;
|
||||
|
||||
#
|
||||
# Bug#27878: Unchecked privileges on a view referring to a table from another
|
||||
@ -1260,6 +1261,7 @@ connection default;
|
||||
REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost';
|
||||
REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
|
||||
REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
|
||||
DROP USER mysqltest_1@localhost;
|
||||
DROP DATABASE db27878;
|
||||
use test;
|
||||
DROP TABLE t1;
|
||||
@ -1278,6 +1280,82 @@ drop user юзер_юзер@localhost;
|
||||
grant select on test.* to очень_длинный_юзер@localhost;
|
||||
set names default;
|
||||
|
||||
#
|
||||
# Bug #20901 - CREATE privilege is enough to insert into a table
|
||||
#
|
||||
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
|
||||
grant create on mysqltest.* to mysqltest@localhost;
|
||||
create table t1 (i INT);
|
||||
|
||||
connect (user1,localhost,mysqltest,,mysqltest);
|
||||
connection user1;
|
||||
# show we don't have INSERT
|
||||
--error 1142
|
||||
insert into t1 values (1);
|
||||
# show we have CREATE
|
||||
create table t2 (i INT);
|
||||
create table t4 (i INT);
|
||||
|
||||
connection default;
|
||||
grant select, insert on mysqltest.t2 to mysqltest@localhost;
|
||||
grant insert on mysqltest.t4 to mysqltest@localhost;
|
||||
# to specify ACLs for non-existent objects, must explictly |CREATE
|
||||
grant create, insert on mysqltest.t5 to mysqltest@localhost;
|
||||
grant create, insert on mysqltest.t6 to mysqltest@localhost;
|
||||
flush privileges;
|
||||
|
||||
connection user1;
|
||||
insert into t2 values (1);
|
||||
|
||||
|
||||
# CREATE IF NOT EXISTS...SELECT, t1 exists, no INSERT, must fail
|
||||
--error 1142
|
||||
create table if not exists t1 select * from t2;
|
||||
|
||||
# CREATE IF NOT EXISTS...SELECT, no t3 yet, no INSERT, must fail
|
||||
--error 1142
|
||||
create table if not exists t3 select * from t2;
|
||||
|
||||
# CREATE IF NOT EXISTS...SELECT, t4 exists, have INSERT, must succeed
|
||||
create table if not exists t4 select * from t2;
|
||||
|
||||
# CREATE IF NOT EXISTS...SELECT, no t5 yet, have INSERT, must succeed
|
||||
create table if not exists t5 select * from t2;
|
||||
|
||||
|
||||
# CREATE...SELECT, no t6 yet, have INSERT, must succeed
|
||||
create table t6 select * from t2;
|
||||
|
||||
# CREATE...SELECT, no t7 yet, no INSERT, must fail
|
||||
--error 1142
|
||||
create table t7 select * from t2;
|
||||
|
||||
# CREATE...SELECT, t4 exists, have INSERT, must still fail (exists)
|
||||
--error 1050
|
||||
create table t4 select * from t2;
|
||||
|
||||
# CREATE...SELECT, t1 exists, no INSERT, must fail
|
||||
--error 1142
|
||||
create table t1 select * from t2;
|
||||
|
||||
|
||||
connection default;
|
||||
drop table t1,t2,t4,t5,t6;
|
||||
|
||||
revoke create on mysqltest.* from mysqltest@localhost;
|
||||
revoke select, insert on mysqltest.t2 from mysqltest@localhost;
|
||||
revoke insert on mysqltest.t4 from mysqltest@localhost;
|
||||
revoke create, insert on mysqltest.t5 from mysqltest@localhost;
|
||||
revoke create, insert on mysqltest.t6 from mysqltest@localhost;
|
||||
drop user mysqltest@localhost;
|
||||
|
||||
disconnect user1;
|
||||
drop database mysqltest;
|
||||
use test;
|
||||
|
||||
|
||||
#
|
||||
# Bug #16470 crash on grant if old grant tables
|
||||
@ -1297,3 +1375,5 @@ DROP DATABASE mysqltest1;
|
||||
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -387,5 +387,106 @@ SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug #26788: mysqld (debug) aborts when inserting specific numbers into char
|
||||
# fields
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a char(20) NOT NULL,
|
||||
b char(7) DEFAULT NULL,
|
||||
c char(4) DEFAULT NULL
|
||||
);
|
||||
|
||||
INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0);
|
||||
INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01);
|
||||
INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15);
|
||||
INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
|
||||
INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
|
||||
INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
|
||||
INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
|
||||
INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
|
||||
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
|
||||
# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and
|
||||
# "1.3e+78" due to different rounding rules
|
||||
--replace_result 12.3 12.2 1.3e+78 1.2e+78
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a char(20) NOT NULL,
|
||||
b char(7) DEFAULT NULL,
|
||||
c char(5)
|
||||
);
|
||||
|
||||
|
||||
INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0);
|
||||
INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01);
|
||||
INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10);
|
||||
INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15);
|
||||
INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203);
|
||||
INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
|
||||
INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
|
||||
INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
|
||||
INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
|
||||
INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
|
||||
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
|
||||
|
||||
# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and
|
||||
# "1.3e+78" due to different rounding rules
|
||||
--replace_result 12.3 12.2 1.3e+78 1.2e+78
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #31152: assertion in Field_str::store(double)
|
||||
#
|
||||
|
||||
CREATE TABLE t (a CHAR(10),b INT);
|
||||
INSERT INTO t VALUES (),(),();
|
||||
INSERT INTO t(a) SELECT rand() FROM t;
|
||||
DROP TABLE t;
|
||||
|
||||
#
|
||||
# Bug #30453: String not cast to int correctly
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c1 INT NOT NULL);
|
||||
INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500),
|
||||
('4188.32999999999992724042385816574096679687500'), (4188);
|
||||
SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE t2 (c1 BIGINT);
|
||||
INSERT INTO t2 VALUES('15449237462.0000000000');
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
|
@ -502,6 +502,26 @@ ORDER BY c.b, c.d
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0
|
||||
#
|
||||
create table t1(a int not null, key aa(a),
|
||||
b char(10) not null, unique key bb(b(1)),
|
||||
c char(4) not null, unique key cc(c));
|
||||
desc t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1(a int not null, key aa(a),
|
||||
b char(10) not null, unique key bb(b(1)),
|
||||
c char(4) not null);
|
||||
desc t1;
|
||||
alter table t1 add unique key cc(c);
|
||||
desc t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
# Bug #31148: bool close_thread_table(THD*, TABLE**): Assertion
|
||||
# `table->key_read == 0' failed.
|
||||
|
@ -213,6 +213,24 @@ SELECT @@slow_query_log, @@log_slow_queries;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||
|
||||
#
|
||||
# Bug #31604: server crash when setting slow_query_log_file/general_log_file
|
||||
#
|
||||
set @old_general_log_file= @@global.general_log_file;
|
||||
set @old_slow_query_log_file= @@global.slow_query_log_file;
|
||||
|
||||
--error 1231
|
||||
set global general_log_file= concat('/not exiting path/log.maste', 'r');
|
||||
--error 1231
|
||||
set global general_log_file= NULL;
|
||||
--error 1231
|
||||
set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
|
||||
--error 1231
|
||||
set global slow_query_log_file= NULL;
|
||||
|
||||
set global general_log_file= @old_general_log_file;
|
||||
set global slow_query_log_file= @old_slow_query_log_file;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
--enable_ps_protocol
|
||||
|
@ -11,7 +11,7 @@
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
|
||||
drop view if exists v1;
|
||||
drop database if exists client_test_db;
|
||||
--enable_warnings
|
||||
@ -37,4 +37,26 @@ create view v1 as select * from t1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #30654: mysqlcheck fails during upgrade of tables whose names include backticks
|
||||
#
|
||||
create table `t``1`(a int);
|
||||
create table `t 1`(a int);
|
||||
--replace_result 'Table is already up to date' OK
|
||||
--exec $MYSQL_CHECK --databases test
|
||||
drop table `t``1`, `t 1`;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
# Bug #30679: 5.1 name encoding not performed for views during upgrade
|
||||
#
|
||||
create table t1(a int);
|
||||
create view v1 as select * from t1;
|
||||
show tables;
|
||||
--copy_file $MYSQLTEST_VARDIR/master-data/test/v1.frm $MYSQLTEST_VARDIR/master-data/test/v-1.frm
|
||||
show tables;
|
||||
--exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test
|
||||
show tables;
|
||||
drop view v1, `v-1`;
|
||||
drop table t1;
|
||||
|
@ -1223,6 +1223,16 @@ EXECUTE st1;
|
||||
DEALLOCATE PREPARE st1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug #32137: prepared statement crash with str_to_date in update clause
|
||||
#
|
||||
create table t1 (a int, b tinyint);
|
||||
prepare st1 from 'update t1 set b= (str_to_date(a, a))';
|
||||
execute st1;
|
||||
deallocate prepare st1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 4.1 tests.
|
||||
|
||||
############################# 5.0 tests start ################################
|
||||
|
@ -21,6 +21,8 @@ select * from information_schema.session_status where variable_name like 'Table_
|
||||
connection con1;
|
||||
# ++Immediate = 3
|
||||
SET SQL_LOG_BIN=0;
|
||||
set @old_general_log = @@global.general_log;
|
||||
set global general_log = 'OFF';
|
||||
--disable_warnings
|
||||
# ++Immediate = 4
|
||||
drop table if exists t1;
|
||||
@ -60,6 +62,7 @@ reap;
|
||||
# ++Immediate = 16 + $wait_condition_reps
|
||||
show status like 'Table_locks_waited';
|
||||
drop table t1;
|
||||
set global general_log = @old_general_log;
|
||||
|
||||
disconnect con2;
|
||||
disconnect con1;
|
||||
|
@ -116,15 +116,10 @@ drop table if exists t1;
|
||||
# Check conversion of floats to character field (Bug #7774)
|
||||
create table t1 (c char(20));
|
||||
insert into t1 values (5e-28);
|
||||
# Expected result is "5e-28", but windows returns "5e-028"
|
||||
--replace_result 5e-028 5e-28
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
create table t1 (c char(6));
|
||||
insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
|
||||
# Expected result is "2e+06", but windows returns "2e+006"
|
||||
# Expected result is "2e-05", but windows returns "2e-005"
|
||||
--replace_result 2e+006 2e+06 2e-005 2e-05
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
@ -1205,6 +1205,27 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #24907: unpredictable (display) precission, if input precission
|
||||
# increases
|
||||
#
|
||||
|
||||
# As per 10.1.1. Overview of Numeric Types, type (new) DECIMAL has a
|
||||
# maxmimum precision of 30 places after the decimal point. Show that
|
||||
# temp field creation beyond that works and throws a truncation warning.
|
||||
# DECIMAL(37,36) should be adjusted to DECIMAL(31,30).
|
||||
CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1;
|
||||
DESC t1;
|
||||
SELECT f1 FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# too many decimal places, AND too many digits altogether (90 = 45+45).
|
||||
# should preserve integers (65 = 45+20)
|
||||
CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1;
|
||||
DESC t1;
|
||||
SELECT f1 FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user