mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk-internal.mysql.com:/data0/bk/mysql-5.0
into bk-internal.mysql.com:/data0/bk/mysql-5.0-kt client/mysql.cc: Auto merged mysql-test/r/gis.result: Auto merged
This commit is contained in:
@ -187,6 +187,7 @@ our $exe_mysqltest;
|
||||
our $exe_slave_mysqld;
|
||||
our $exe_im;
|
||||
our $exe_my_print_defaults;
|
||||
our $exe_perror;
|
||||
our $lib_udf_example;
|
||||
our $exe_libtool;
|
||||
|
||||
@ -811,6 +812,13 @@ sub command_line_setup () {
|
||||
$opt_with_ndbcluster= 0;
|
||||
}
|
||||
|
||||
# Check IM arguments
|
||||
if ( $glob_win32 )
|
||||
{
|
||||
mtr_report("Disable Instance manager - not supported on Windows");
|
||||
$opt_skip_im= 1;
|
||||
}
|
||||
|
||||
# Check valgrind arguments
|
||||
if ( $opt_valgrind or $opt_valgrind_path or defined $opt_valgrind_options)
|
||||
{
|
||||
@ -1048,6 +1056,8 @@ sub executable_setup () {
|
||||
$path_charsetsdir= mtr_path_exists("$glob_basedir/share/charsets");
|
||||
$exe_my_print_defaults=
|
||||
mtr_exe_exists("$path_client_bindir/my_print_defaults");
|
||||
$exe_perror=
|
||||
mtr_exe_exists("$path_client_bindir/perror");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1060,6 +1070,8 @@ sub executable_setup () {
|
||||
"$glob_basedir/server-tools/instance-manager/mysqlmanager");
|
||||
$exe_my_print_defaults=
|
||||
mtr_exe_exists("$glob_basedir/extra/my_print_defaults");
|
||||
$exe_perror=
|
||||
mtr_exe_exists("$glob_basedir/extra/perror");
|
||||
}
|
||||
|
||||
if ( $glob_use_embedded_server )
|
||||
@ -1107,6 +1119,8 @@ sub executable_setup () {
|
||||
"$glob_basedir/scripts/mysql_fix_privilege_tables");
|
||||
$exe_my_print_defaults=
|
||||
mtr_exe_exists("$path_client_bindir/my_print_defaults");
|
||||
$exe_perror=
|
||||
mtr_exe_exists("$path_client_bindir/perror");
|
||||
|
||||
$path_language= mtr_path_exists("$glob_basedir/share/mysql/english/",
|
||||
"$glob_basedir/share/english/");
|
||||
@ -3132,6 +3146,7 @@ sub run_mysqltest ($) {
|
||||
$ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults;
|
||||
$ENV{'UDF_EXAMPLE_LIB'}=
|
||||
($lib_udf_example ? basename($lib_udf_example) : "");
|
||||
$ENV{'MY_PERROR'}= $exe_perror;
|
||||
|
||||
$ENV{'NDB_MGM'}= $exe_ndb_mgm;
|
||||
$ENV{'NDB_BACKUP_DIR'}= $path_ndb_data_dir;
|
||||
|
@ -381,3 +381,14 @@ DROP TABLE t1;
|
||||
select cast(NULL as decimal(6)) as t1;
|
||||
t1
|
||||
NULL
|
||||
set names latin1;
|
||||
select hex(cast('a' as char(2) binary));
|
||||
hex(cast('a' as char(2) binary))
|
||||
61
|
||||
select hex(cast('a' as binary(2)));
|
||||
hex(cast('a' as binary(2)))
|
||||
6100
|
||||
select hex(cast('a' as char(2) binary));
|
||||
hex(cast('a' as char(2) binary))
|
||||
61
|
||||
End of 5.0 tests
|
||||
|
@ -449,6 +449,8 @@ create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%
|
||||
str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
|
||||
str_to_date("2003-01-02", "%Y-%m-%d") as f3,
|
||||
str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f4' at row 1
|
||||
describe t1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 datetime YES NULL
|
||||
@ -458,7 +460,7 @@ f4 date YES NULL
|
||||
f5 time YES NULL
|
||||
select * from t1;
|
||||
f1 f2 f3 f4 f5
|
||||
2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-02 58:00:00
|
||||
2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-00 58:00:00
|
||||
drop table t1;
|
||||
create table t1 select "02 10" as a, "%d %H" as b;
|
||||
select str_to_date(a,b) from t1;
|
||||
|
@ -192,3 +192,13 @@ delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
|
||||
select * from t3;
|
||||
a b
|
||||
drop table t1,t2,t3;
|
||||
create table t1(a date not null);
|
||||
insert into t1 values (0);
|
||||
select * from t1 where a is null;
|
||||
a
|
||||
0000-00-00
|
||||
delete from t1 where a is null;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
drop table t1;
|
||||
|
@ -967,6 +967,8 @@ CREATE TABLE federated.t1 (
|
||||
`blurb` text default '',
|
||||
PRIMARY KEY (blurb_id))
|
||||
DEFAULT CHARSET=latin1;
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`blurb_id` int NOT NULL DEFAULT 0,
|
||||
@ -975,6 +977,8 @@ PRIMARY KEY (blurb_id))
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
|
||||
INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.");
|
||||
INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
|
||||
INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
|
||||
|
@ -8,6 +8,8 @@ KEY kt(tag),
|
||||
KEY kv(value(15)),
|
||||
FULLTEXT KEY kvf(value)
|
||||
) ENGINE=MyISAM;
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'value' can't have a default value
|
||||
CREATE TABLE t2 (
|
||||
id_t2 mediumint unsigned NOT NULL default '0',
|
||||
id_t1 mediumint unsigned NOT NULL default '0',
|
||||
|
@ -9,6 +9,8 @@ name VARCHAR(80) DEFAULT '' NOT NULL,
|
||||
FULLTEXT(url,description,shortdesc,longdesc),
|
||||
PRIMARY KEY(gnr)
|
||||
);
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'longdesc' can't have a default value
|
||||
insert into test (url,shortdesc,longdesc,description,name) VALUES
|
||||
("http:/test.at", "kurz", "lang","desc", "name");
|
||||
insert into test (url,shortdesc,longdesc,description,name) VALUES
|
||||
|
@ -79,3 +79,31 @@ uncompress(a) uncompressed_length(a)
|
||||
NULL NULL
|
||||
a 1
|
||||
drop table t1;
|
||||
create table t1 (a varchar(32) not null);
|
||||
insert into t1 values ('foo');
|
||||
explain select * from t1 where uncompress(a) is null;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
||||
Warnings:
|
||||
Error 1259 ZLIB: Input data corrupted
|
||||
select * from t1 where uncompress(a) is null;
|
||||
a
|
||||
foo
|
||||
Warnings:
|
||||
Error 1259 ZLIB: Input data corrupted
|
||||
explain select *, uncompress(a) 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 *, uncompress(a) from t1;
|
||||
a uncompress(a)
|
||||
foo NULL
|
||||
Warnings:
|
||||
Error 1259 ZLIB: Input data corrupted
|
||||
select *, uncompress(a), uncompress(a) is null from t1;
|
||||
a uncompress(a) uncompress(a) is null
|
||||
foo NULL 1
|
||||
Warnings:
|
||||
Error 1259 ZLIB: Input data corrupted
|
||||
Error 1259 ZLIB: Input data corrupted
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
@ -999,3 +999,17 @@ FROM t1 t, t2 c WHERE t.a = c.b;
|
||||
minid
|
||||
NULL
|
||||
DROP TABLE t1,t2;
|
||||
create table t1 select variance(0);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`variance(0)` double(8,4) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 select stddev(0);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`stddev(0)` double(8,4) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
|
@ -667,6 +667,78 @@ timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3,
|
||||
timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4;
|
||||
a1 a2 a3 a4
|
||||
28 28 29 29
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:27');
|
||||
TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:27')
|
||||
0
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:28');
|
||||
TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:28')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:29');
|
||||
TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:29')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:27');
|
||||
TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:27')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:28');
|
||||
TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:28')
|
||||
2
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:29');
|
||||
TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:29')
|
||||
2
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:27');
|
||||
TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:27')
|
||||
0
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:28');
|
||||
TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:28')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:29');
|
||||
TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:29')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:27');
|
||||
TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:27')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:28');
|
||||
TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:28')
|
||||
2
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:29');
|
||||
TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:29')
|
||||
2
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:27');
|
||||
TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:27')
|
||||
0
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:28');
|
||||
TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:28')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:29');
|
||||
TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:29')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:27');
|
||||
TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:27')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:28');
|
||||
TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:28')
|
||||
2
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:29');
|
||||
TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:29')
|
||||
2
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:27');
|
||||
TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:27')
|
||||
0
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:28');
|
||||
TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:28')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:29');
|
||||
TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:29')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:27');
|
||||
TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:27')
|
||||
1
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:28');
|
||||
TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:28')
|
||||
2
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:29');
|
||||
TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:29')
|
||||
2
|
||||
select date_add(time,INTERVAL 1 SECOND) from t1;
|
||||
date_add(time,INTERVAL 1 SECOND)
|
||||
NULL
|
||||
|
@ -804,6 +804,8 @@ INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
drop table t1, t2;
|
||||
CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'geometry' can't have a default value
|
||||
INSERT INTO t1 (geometry) VALUES
|
||||
(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
|
||||
-66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
|
||||
@ -820,6 +822,8 @@ CREATE TABLE t1 (
|
||||
c1 geometry NOT NULL default '',
|
||||
SPATIAL KEY i1 (c1(32))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'c1' can't have a default value
|
||||
INSERT INTO t1 (c1) VALUES (
|
||||
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
|
||||
-18.6055555000 -66.8158332999,
|
||||
@ -834,6 +838,8 @@ CREATE TABLE t1 (
|
||||
c1 geometry NOT NULL default '',
|
||||
SPATIAL KEY i1 (c1(32))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'c1' can't have a default value
|
||||
INSERT INTO t1 (c1) VALUES (
|
||||
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
|
||||
-18.6055555000 -66.8158332999,
|
||||
|
@ -583,6 +583,8 @@ t1 CREATE TABLE `t1` (
|
||||
drop table t1;
|
||||
CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo`
|
||||
geometry NOT NULL default '') ENGINE=MyISAM ;
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'geo' can't have a default value
|
||||
insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
|
||||
36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163
|
||||
36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363
|
||||
|
2
mysql-test/r/have_perror.require
Normal file
2
mysql-test/r/have_perror.require
Normal file
@ -0,0 +1,2 @@
|
||||
have_perror
|
||||
1
|
@ -598,6 +598,8 @@ id int(11) DEFAULT '0' NOT NULL,
|
||||
name tinytext DEFAULT '' NOT NULL,
|
||||
UNIQUE id (id)
|
||||
);
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'name' can't have a default value
|
||||
INSERT INTO t1 VALUES (1,'yes'),(2,'no');
|
||||
CREATE TABLE t2 (
|
||||
id int(11) DEFAULT '0' NOT NULL,
|
||||
|
@ -104,4 +104,14 @@ c_cp932
|
||||
| 2 | NULL |
|
||||
| 3 | |
|
||||
+------+------+
|
||||
create table t1(a int, b varchar(255), c int);
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
b varchar(255) YES NULL
|
||||
c int(11) YES NULL
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
b varchar(255) YES NULL
|
||||
c int(11) YES NULL
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
@ -32,3 +32,10 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
create table t1 (a int);
|
||||
create view v1 as select * from t1;
|
||||
test.t1 OK
|
||||
test.t1 OK
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
@ -2875,3 +2875,20 @@ use mysqldump_dbb;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop database mysqldump_dbb;
|
||||
use test;
|
||||
create user mysqltest_1;
|
||||
create table t1(a int, b varchar(34));
|
||||
reset master;
|
||||
mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
|
||||
mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
|
||||
grant RELOAD on *.* to mysqltest_1@localhost;
|
||||
mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227)
|
||||
mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227)
|
||||
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
|
||||
CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=537;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL,
|
||||
`b` varchar(34) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
drop table t1;
|
||||
drop user mysqltest_1;
|
||||
|
@ -75,3 +75,52 @@ Database: test
|
||||
2 rows in set.
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
Database: information_schema
|
||||
+---------------------------------------+
|
||||
| Tables |
|
||||
+---------------------------------------+
|
||||
| CHARACTER_SETS |
|
||||
| COLLATIONS |
|
||||
| COLLATION_CHARACTER_SET_APPLICABILITY |
|
||||
| COLUMNS |
|
||||
| COLUMN_PRIVILEGES |
|
||||
| KEY_COLUMN_USAGE |
|
||||
| ROUTINES |
|
||||
| SCHEMATA |
|
||||
| SCHEMA_PRIVILEGES |
|
||||
| STATISTICS |
|
||||
| TABLES |
|
||||
| TABLE_CONSTRAINTS |
|
||||
| TABLE_PRIVILEGES |
|
||||
| TRIGGERS |
|
||||
| USER_PRIVILEGES |
|
||||
| VIEWS |
|
||||
+---------------------------------------+
|
||||
Database: INFORMATION_SCHEMA
|
||||
+---------------------------------------+
|
||||
| Tables |
|
||||
+---------------------------------------+
|
||||
| CHARACTER_SETS |
|
||||
| COLLATIONS |
|
||||
| COLLATION_CHARACTER_SET_APPLICABILITY |
|
||||
| COLUMNS |
|
||||
| COLUMN_PRIVILEGES |
|
||||
| KEY_COLUMN_USAGE |
|
||||
| ROUTINES |
|
||||
| SCHEMATA |
|
||||
| SCHEMA_PRIVILEGES |
|
||||
| STATISTICS |
|
||||
| TABLES |
|
||||
| TABLE_CONSTRAINTS |
|
||||
| TABLE_PRIVILEGES |
|
||||
| TRIGGERS |
|
||||
| USER_PRIVILEGES |
|
||||
| VIEWS |
|
||||
+---------------------------------------+
|
||||
Wildcard: inf_rmation_schema
|
||||
+--------------------+
|
||||
| Databases |
|
||||
+--------------------+
|
||||
| information_schema |
|
||||
+--------------------+
|
||||
End of 5.0 tests
|
||||
|
@ -441,3 +441,9 @@ select-me
|
||||
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 'insertz error query' at line 1
|
||||
drop table t1;
|
||||
drop table t1;
|
||||
sleep;
|
||||
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 'sleep' at line 1
|
||||
sleep;
|
||||
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 'sleep' at line 1
|
||||
;
|
||||
ERROR 42000: Query was empty
|
||||
|
@ -748,3 +748,4 @@ f1 f2 f3
|
||||
111111 aaaaaa 1
|
||||
222222 bbbbbb 2
|
||||
drop table t1;
|
||||
Illegal ndb error code: 1186
|
||||
|
@ -280,6 +280,8 @@ info text NOT NULL default '',
|
||||
ipnr varchar(30) NOT NULL default '',
|
||||
PRIMARY KEY (member_id)
|
||||
) ENGINE=MyISAM PACK_KEYS=1;
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'info' can't have a default value
|
||||
insert into t1 (member_id) values (1),(2),(3);
|
||||
select member_id, nickname, voornaam FROM t1
|
||||
ORDER by lastchange_datum DESC LIMIT 2;
|
||||
|
1
mysql-test/r/perror.result
Normal file
1
mysql-test/r/perror.result
Normal file
@ -0,0 +1 @@
|
||||
Illegal error code: 10000
|
@ -5,7 +5,9 @@ select @@sql_mode;
|
||||
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (col1 date);
|
||||
INSERT INTO t1 VALUES('2004-01-01'),('0000-10-31'),('2004-02-29');
|
||||
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
|
||||
INSERT INTO t1 VALUES('0000-10-31');
|
||||
ERROR 22007: Incorrect date value: '0000-10-31' for column 'col1' at row 1
|
||||
INSERT INTO t1 VALUES('2004-0-31');
|
||||
ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 1
|
||||
INSERT INTO t1 VALUES('2004-01-02'),('2004-0-31');
|
||||
@ -54,7 +56,6 @@ Warning 1265 Data truncated for column 'col1' at row 3
|
||||
select * from t1;
|
||||
col1
|
||||
2004-01-01
|
||||
0000-10-31
|
||||
2004-02-29
|
||||
2004-01-02
|
||||
2004-01-03
|
||||
@ -121,7 +122,9 @@ col1
|
||||
drop table t1;
|
||||
set @@sql_mode='ansi,traditional';
|
||||
CREATE TABLE t1 (col1 datetime);
|
||||
INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('0000-10-31 15:30:00'),('2004-02-29 15:30:00');
|
||||
INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
|
||||
INSERT INTO t1 VALUES('0000-10-31 15:30:00');
|
||||
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col1' at row 1
|
||||
INSERT INTO t1 VALUES('2004-0-31 15:30:00');
|
||||
ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1
|
||||
INSERT INTO t1 VALUES('2004-10-0 15:30:00');
|
||||
@ -141,7 +144,6 @@ ERROR 22007: Incorrect datetime value: '59' for column 'col1' at row 1
|
||||
select * from t1;
|
||||
col1
|
||||
2004-10-31 15:30:00
|
||||
0000-10-31 15:30:00
|
||||
2004-02-29 15:30:00
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (col1 timestamp);
|
||||
@ -204,6 +206,7 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y'));
|
||||
INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
|
||||
INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
|
||||
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
|
||||
ERROR 22007: Incorrect date value: '0000-10-31 15:30:00' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
|
||||
ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
|
||||
@ -219,6 +222,7 @@ ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_ti
|
||||
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
|
||||
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
|
||||
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col2' at row 1
|
||||
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
|
||||
ERROR 22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col2' at row 1
|
||||
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
|
||||
@ -255,6 +259,7 @@ INSERT INTO t1 (col1) VALUES (CAST('2004-10-15' AS DATE));
|
||||
INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
|
||||
INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
|
||||
INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE));
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-10-31'
|
||||
INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE));
|
||||
ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE));
|
||||
@ -262,6 +267,7 @@ ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE));
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
|
||||
INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30'
|
||||
INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
|
||||
INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
|
||||
@ -269,7 +275,7 @@ ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' a
|
||||
INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
|
||||
INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30'
|
||||
INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
|
||||
INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
|
||||
@ -282,6 +288,7 @@ INSERT INTO t1 (col1) VALUES (CONVERT('2004-10-15',DATE));
|
||||
INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
|
||||
INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE));
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-10-31'
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE));
|
||||
ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE));
|
||||
@ -289,6 +296,7 @@ ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE));
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30'
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
|
||||
@ -296,7 +304,7 @@ ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' a
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME));
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
|
||||
INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
|
||||
ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30'
|
||||
INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
|
||||
INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
|
||||
|
@ -503,6 +503,8 @@ foobar boggle
|
||||
fish 10
|
||||
drop table t1;
|
||||
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default '');
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'imagem' can't have a default value
|
||||
insert into t1 (id) values (1);
|
||||
select
|
||||
charset(load_file('../../std_data/words.dat')),
|
||||
@ -788,3 +790,21 @@ NULL
|
||||
616100000000
|
||||
620000000000
|
||||
drop table t1;
|
||||
create table t1 (a text default '');
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'a' can't have a default value
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
insert into t1 values (default);
|
||||
select * from t1;
|
||||
a
|
||||
NULL
|
||||
drop table t1;
|
||||
set @@sql_mode='TRADITIONAL';
|
||||
create table t1 (a text default '');
|
||||
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
|
||||
set @@sql_mode='';
|
||||
End of 5.0 tests
|
||||
|
@ -26,6 +26,8 @@ Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
delete from t1;
|
||||
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
|
||||
Warnings:
|
||||
Warning 1264 Out of range value adjusted for column 't' at row 5
|
||||
insert into t1 values ("2003-003-03");
|
||||
insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01");
|
||||
select * from t1;
|
||||
@ -34,7 +36,7 @@ t
|
||||
2069-12-31 00:00:00
|
||||
1970-01-01 00:00:00
|
||||
1999-12-31 00:00:00
|
||||
0000-01-01 00:00:00
|
||||
0000-00-00 00:00:00
|
||||
0001-01-01 00:00:00
|
||||
9999-12-31 00:00:00
|
||||
2000-10-10 00:00:00
|
||||
|
@ -38,6 +38,9 @@ KEY (ulong),
|
||||
KEY (ulonglong,ulong),
|
||||
KEY (options,flags)
|
||||
);
|
||||
Warnings:
|
||||
Warning 1101 BLOB/TEXT column 'mediumblob_col' can't have a default value
|
||||
Warning 1101 BLOB/TEXT column 'longblob_col' can't have a default value
|
||||
show full fields from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
auto int(5) unsigned NULL NO PRI NULL auto_increment #
|
||||
|
@ -1318,7 +1318,7 @@ t2 CREATE TABLE `t2` (
|
||||
`f5` timestamp NOT NULL default '0000-00-00 00:00:00',
|
||||
`f6` varchar(1) character set utf8 default NULL,
|
||||
`f7` text,
|
||||
`f8` text character set utf8
|
||||
`f8` mediumtext character set utf8
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2;
|
||||
(select avg(1)) union (select avg(1)) union (select avg(1)) union
|
||||
@ -1366,3 +1366,8 @@ drop table t1, t2;
|
||||
(select avg(1)) union (select avg(1)) union (select avg(1));
|
||||
avg(1)
|
||||
NULL
|
||||
select _utf8'12' union select _latin1'12345';
|
||||
12
|
||||
12
|
||||
12345
|
||||
End of 5.0 tests
|
||||
|
@ -256,3 +256,39 @@ t1 CREATE TABLE `t1` (
|
||||
`@first_var` longtext
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
set @a=18446744071710965857;
|
||||
select @a;
|
||||
@a
|
||||
18446744071710965857
|
||||
CREATE TABLE `bigfailure` (
|
||||
`afield` BIGINT UNSIGNED NOT NULL
|
||||
);
|
||||
INSERT INTO `bigfailure` VALUES (18446744071710965857);
|
||||
SELECT * FROM bigfailure;
|
||||
afield
|
||||
18446744071710965857
|
||||
select * from (SELECT afield FROM bigfailure) as b;
|
||||
afield
|
||||
18446744071710965857
|
||||
select * from bigfailure where afield = (SELECT afield FROM bigfailure);
|
||||
afield
|
||||
18446744071710965857
|
||||
select * from bigfailure where afield = 18446744071710965857;
|
||||
afield
|
||||
18446744071710965857
|
||||
select * from bigfailure where afield = 18446744071710965856+1;
|
||||
afield
|
||||
18446744071710965857
|
||||
SET @a := (SELECT afield FROM bigfailure);
|
||||
SELECT @a;
|
||||
@a
|
||||
18446744071710965857
|
||||
SET @a := (select afield from (SELECT afield FROM bigfailure) as b);
|
||||
SELECT @a;
|
||||
@a
|
||||
18446744071710965857
|
||||
SET @a := (select * from bigfailure where afield = (SELECT afield FROM bigfailure));
|
||||
SELECT @a;
|
||||
@a
|
||||
18446744071710965857
|
||||
drop table bigfailure;
|
||||
|
@ -204,7 +204,19 @@ SELECT CAST(v AS DECIMAL), CAST(tt AS DECIMAL), CAST(t AS DECIMAL),
|
||||
CAST(mt AS DECIMAL), CAST(lt AS DECIMAL) from t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
# Bug @10237 (CAST(NULL DECIMAL) crashes server)
|
||||
|
||||
#
|
||||
# Bug #10237 (CAST(NULL DECIMAL) crashes server)
|
||||
#
|
||||
select cast(NULL as decimal(6)) as t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug #17903: cast to char results in binary
|
||||
#
|
||||
set names latin1;
|
||||
select hex(cast('a' as char(2) binary));
|
||||
select hex(cast('a' as binary(2)));
|
||||
select hex(cast('a' as char(2) binary));
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -171,3 +171,14 @@ delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
|
||||
# This should be empty
|
||||
select * from t3;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# Bug #8143: deleting '0000-00-00' values using IS NULL
|
||||
#
|
||||
|
||||
create table t1(a date not null);
|
||||
insert into t1 values (0);
|
||||
select * from t1 where a is null;
|
||||
delete from t1 where a is null;
|
||||
select count(*) from t1;
|
||||
drop table t1;
|
||||
|
@ -11,4 +11,3 @@
|
||||
##############################################################################
|
||||
|
||||
ndb_load : Bug#17233
|
||||
lowercase_fs_off : Bug#21419
|
||||
|
@ -57,3 +57,17 @@ select uncompress(a), uncompressed_length(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
# Bug #18539: uncompress(d) is null: impossible?
|
||||
#
|
||||
create table t1 (a varchar(32) not null);
|
||||
insert into t1 values ('foo');
|
||||
explain select * from t1 where uncompress(a) is null;
|
||||
select * from t1 where uncompress(a) is null;
|
||||
explain select *, uncompress(a) from t1;
|
||||
select *, uncompress(a) from t1;
|
||||
select *, uncompress(a), uncompress(a) is null from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -675,3 +675,15 @@ SELECT SQL_NO_CACHE
|
||||
FROM t1 t, t2 c WHERE t.a = c.b;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug #10966: Variance functions return wrong data type
|
||||
#
|
||||
|
||||
create table t1 select variance(0);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 select stddev(0);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
|
@ -318,6 +318,37 @@ select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1,
|
||||
timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3,
|
||||
timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4;
|
||||
|
||||
# bug 16226
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:27');
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:28');
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:29');
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:27');
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:28');
|
||||
SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:29');
|
||||
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:27');
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:28');
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:29');
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:27');
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:28');
|
||||
SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:29');
|
||||
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:27');
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:28');
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:29');
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:27');
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:28');
|
||||
SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:29');
|
||||
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:27');
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:28');
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:29');
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:27');
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:28');
|
||||
SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:29');
|
||||
|
||||
# end of bug
|
||||
|
||||
select date_add(time,INTERVAL 1 SECOND) from t1;
|
||||
drop table t1;
|
||||
|
||||
|
@ -77,6 +77,23 @@ drop table t1;
|
||||
#
|
||||
--exec $MYSQL -t test -e "create table b19564 (i int, s1 char(1)); insert into b19564 values (1, 'x'); insert into b19564 values (2, NULL); insert into b19564 values (3, ' '); select * from b19564 order by i; drop table b19564;"
|
||||
|
||||
#
|
||||
# Bug#19265 describe command does not work from mysql prompt
|
||||
#
|
||||
|
||||
create table t1(a int, b varchar(255), c int);
|
||||
--exec $MYSQL test -e "desc t1"
|
||||
--exec $MYSQL test -e "desc t1\g"
|
||||
drop table t1;
|
||||
|
||||
--disable_parsing
|
||||
#
|
||||
# Bug#21042 mysql client segfaults on importing a mysqldump export
|
||||
#
|
||||
--error 1
|
||||
--exec $MYSQL test -e "connect verylongdatabasenamethatshouldblowthe256byteslongbufferincom_connectfunctionxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxendcccccccdxxxxxxxxxxxxxxxxxkskskskskkskskskskskskskskskskkskskskskkskskskskskskskskskend" 2>&1
|
||||
--enable_parsing
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
||||
|
@ -9,3 +9,17 @@
|
||||
--replace_result 'Table is already up to date' OK
|
||||
--exec $MYSQL_CHECK --analyze --optimize --databases test information_schema mysql
|
||||
--exec $MYSQL_CHECK --analyze --optimize information_schema schemata
|
||||
|
||||
#
|
||||
# Bug #16502: mysqlcheck tries to check views
|
||||
#
|
||||
create table t1 (a int);
|
||||
create view v1 as select * from t1;
|
||||
--replace_result 'Table is already up to date' OK
|
||||
--exec $MYSQL_CHECK --analyze --optimize --databases test
|
||||
--replace_result 'Table is already up to date' OK
|
||||
--exec $MYSQL_CHECK --all-in-1 --analyze --optimize --databases test
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -1266,3 +1266,46 @@ use mysqldump_dbb;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop database mysqldump_dbb;
|
||||
|
||||
#
|
||||
# Bug#21215 mysqldump creating incomplete backups without warning
|
||||
#
|
||||
use test;
|
||||
|
||||
# Create user without sufficient privs to perform the requested operation
|
||||
create user mysqltest_1;
|
||||
create table t1(a int, b varchar(34));
|
||||
|
||||
# To get consistent output, reset the master, starts over from first log
|
||||
reset master;
|
||||
|
||||
# Execute mysqldump, will fail on FLUSH TABLES
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
|
||||
|
||||
# Execute mysqldump, will fail on FLUSH TABLES
|
||||
# use --force, should no affect behaviour
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --compact --force --master-data -u mysqltest_1 test 2>&1
|
||||
|
||||
# Add RELOAD grants
|
||||
grant RELOAD on *.* to mysqltest_1@localhost;
|
||||
|
||||
# Execute mysqldump, will fail on SHOW MASTER STATUS
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
|
||||
|
||||
# Execute mysqldump, will fail on SHOW MASTER STATUS.
|
||||
# use --force, should not alter behaviour
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --compact --force --master-data -u mysqltest_1 test 2>&1
|
||||
|
||||
# Add REPLICATION CLIENT grants
|
||||
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
|
||||
|
||||
# Execute mysqldump, should now succeed
|
||||
--exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
|
||||
|
||||
# Clean up
|
||||
drop table t1;
|
||||
drop user mysqltest_1;
|
||||
|
@ -25,3 +25,12 @@ select "---- -v -t ---------" as "";
|
||||
select "---- -v -v -t ------" as "";
|
||||
--exec $MYSQL_SHOW test -v -v -t
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug #19147: mysqlshow INFORMATION_SCHEMA does not work
|
||||
#
|
||||
--exec $MYSQL_SHOW information_schema
|
||||
--exec $MYSQL_SHOW INFORMATION_SCHEMA
|
||||
--exec $MYSQL_SHOW inf_rmation_schema
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -1125,3 +1125,18 @@ drop table t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug#19890 mysqltest: "query" command is broken
|
||||
#
|
||||
|
||||
# It should be possible to use the command "query" to force mysqltest to
|
||||
# send the command to the server although it's a builtin mysqltest command.
|
||||
--error 1064
|
||||
query sleep;
|
||||
|
||||
--error 1064
|
||||
--query sleep
|
||||
|
||||
# Just an empty query command
|
||||
--error 1065
|
||||
query ;
|
||||
|
@ -700,3 +700,13 @@ select * from t1 order by f1;
|
||||
select * from t1 order by f2;
|
||||
select * from t1 order by f3;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#16561 Unknown ERROR msg "ERROR 1186 (HY000): Binlog closed" by perror
|
||||
#
|
||||
|
||||
# As long there is no error code 1186 defined by NDB
|
||||
# we should get a message "Illegal ndb error code: 1186"
|
||||
--error 1
|
||||
--exec $MY_PERROR --ndb 1186 2>&1
|
||||
|
||||
|
19
mysql-test/t/perror.test
Normal file
19
mysql-test/t/perror.test
Normal file
@ -0,0 +1,19 @@
|
||||
#
|
||||
# Check if the variable MY_PERROR is set
|
||||
#
|
||||
--require r/have_perror.require
|
||||
disable_query_log;
|
||||
eval select LENGTH("$MY_PERROR") > 0 as "have_perror";
|
||||
enable_query_log;
|
||||
|
||||
--exec $MY_PERROR 150 > /dev/null
|
||||
--exec $MY_PERROR --silent 120 > /dev/null
|
||||
|
||||
#
|
||||
# Bug#16561 Unknown ERROR msg "ERROR 1186 (HY000): Binlog closed" by perror
|
||||
#
|
||||
|
||||
# Test with error code 10000 as it's a common "unknown error"
|
||||
# As there is no error code defined for 10000, expect error
|
||||
--error 1
|
||||
--exec $MY_PERROR 10000 2>&1
|
@ -13,7 +13,9 @@ DROP TABLE IF EXISTS t1;
|
||||
# Test INSERT with DATE
|
||||
|
||||
CREATE TABLE t1 (col1 date);
|
||||
INSERT INTO t1 VALUES('2004-01-01'),('0000-10-31'),('2004-02-29');
|
||||
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
|
||||
--error 1292
|
||||
INSERT INTO t1 VALUES('0000-10-31');
|
||||
|
||||
# All test cases expected to fail should return
|
||||
# SQLSTATE 22007 <invalid date value>
|
||||
@ -97,7 +99,9 @@ set @@sql_mode='ansi,traditional';
|
||||
# Test INSERT with DATETIME
|
||||
|
||||
CREATE TABLE t1 (col1 datetime);
|
||||
INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('0000-10-31 15:30:00'),('2004-02-29 15:30:00');
|
||||
INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
|
||||
--error 1292
|
||||
INSERT INTO t1 VALUES('0000-10-31 15:30:00');
|
||||
|
||||
# All test cases expected to fail should return
|
||||
# SQLSTATE 22007 <invalid datetime value>
|
||||
@ -190,6 +194,7 @@ INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
|
||||
# All test cases expected to fail should return
|
||||
# SQLSTATE 22007 <invalid date value>
|
||||
|
||||
--error 1292
|
||||
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
|
||||
|
||||
--error 1292
|
||||
@ -211,6 +216,7 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
|
||||
# All test cases expected to fail should return
|
||||
# SQLSTATE 22007 <invalid datetime value>
|
||||
|
||||
--error 1292
|
||||
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
|
||||
|
||||
--error 1292
|
||||
@ -264,6 +270,8 @@ INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
|
||||
## Test INSERT with CAST AS DATE into DATE
|
||||
# All test cases expected to fail should return
|
||||
# SQLSTATE 22007 <invalid date value>
|
||||
|
||||
--error 1292
|
||||
INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE));
|
||||
|
||||
--error 1292
|
||||
@ -290,6 +298,8 @@ INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE));
|
||||
## Test INSERT with CAST AS DATETIME into DATETIME
|
||||
# All test cases expected to fail should return
|
||||
# SQLSTATE 22007 <invalid datetime value>
|
||||
|
||||
--error 1292
|
||||
INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
|
||||
|
||||
--error 1292
|
||||
@ -356,6 +366,8 @@ INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
|
||||
## Test INSERT with CONVERT to DATE into DATE
|
||||
# All test cases expected to fail should return
|
||||
# SQLSTATE 22007 <invalid date value>
|
||||
|
||||
--error 1292
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE));
|
||||
|
||||
--error 1292
|
||||
@ -381,6 +393,8 @@ INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE));
|
||||
## Test INSERT with CONVERT to DATETIME into DATETIME
|
||||
# All test cases expected to fail should return
|
||||
# SQLSTATE 22007 <invalid datetime value>
|
||||
|
||||
--error 1292
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
|
||||
|
||||
--error 1292
|
||||
|
@ -423,3 +423,18 @@ alter table t1 modify a binary(5);
|
||||
select hex(a) from t1 order by a;
|
||||
select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #19489: Inconsistent support for DEFAULT in TEXT columns
|
||||
#
|
||||
create table t1 (a text default '');
|
||||
show create table t1;
|
||||
insert into t1 values (default);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
set @@sql_mode='TRADITIONAL';
|
||||
--error ER_BLOB_CANT_HAVE_DEFAULT
|
||||
create table t1 (a text default '');
|
||||
set @@sql_mode='';
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -849,3 +849,10 @@ drop table t1, t2;
|
||||
(select avg(1)) union (select avg(1)) union (select avg(1)) union
|
||||
(select avg(1)) union (select avg(1)) union (select avg(1));
|
||||
|
||||
#
|
||||
# Bug #16881: password() and union select
|
||||
# (The issue was poor handling of character set aggregation.)
|
||||
#
|
||||
select _utf8'12' union select _latin1'12345';
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -171,3 +171,34 @@ set @first_var= cast(NULL as CHAR);
|
||||
create table t1 select @first_var;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #7498 User variable SET saves SIGNED BIGINT as UNSIGNED BIGINT
|
||||
#
|
||||
|
||||
# First part, set user var to large number and select it
|
||||
set @a=18446744071710965857;
|
||||
select @a;
|
||||
|
||||
# Second part, set user var from large number in table
|
||||
# then select it
|
||||
CREATE TABLE `bigfailure` (
|
||||
`afield` BIGINT UNSIGNED NOT NULL
|
||||
);
|
||||
INSERT INTO `bigfailure` VALUES (18446744071710965857);
|
||||
SELECT * FROM bigfailure;
|
||||
select * from (SELECT afield FROM bigfailure) as b;
|
||||
select * from bigfailure where afield = (SELECT afield FROM bigfailure);
|
||||
select * from bigfailure where afield = 18446744071710965857;
|
||||
# This is fixed in 5.0, to be uncommented there
|
||||
#select * from bigfailure where afield = '18446744071710965857';
|
||||
select * from bigfailure where afield = 18446744071710965856+1;
|
||||
|
||||
SET @a := (SELECT afield FROM bigfailure);
|
||||
SELECT @a;
|
||||
SET @a := (select afield from (SELECT afield FROM bigfailure) as b);
|
||||
SELECT @a;
|
||||
SET @a := (select * from bigfailure where afield = (SELECT afield FROM bigfailure));
|
||||
SELECT @a;
|
||||
|
||||
drop table bigfailure;
|
||||
|
Reference in New Issue
Block a user