mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
a444a3449f
Cleaned up (and disabled part of) date/time/datetime format patch. One can't anymore change default read/write date/time/formats. This is becasue the non standard datetime formats can't be compared as strings and MySQL does still a lot of datetime comparisons as strings Changed flag argument to str_to_TIME() and get_date() from bool to uint Removed THD from str_to_xxxx functions and Item class. Fixed core dump when doing --print-defaults Move some common string functions to strfunc.cc Dates as strings are now of type my_charset_bin instead of default_charset() Introduce IDENT_QUOTED to not have to create an extra copy of simple identifiers (all chars < 128) Removed xxx_FORMAT_TYPE enums and replaced them with the old TIMESTAMP_xxx enums Renamed some TIMESTAMP_xxx enums to more appropriate names Use defines instead of integers for date/time/datetime string lengths Added to build system and use the new my_strtoll10() function.
95 lines
3.1 KiB
Text
95 lines
3.1 KiB
Text
-- require r/have_symlink.require
|
|
disable_query_log;
|
|
show variables like "have_symlink";
|
|
enable_query_log;
|
|
|
|
--disable_warnings
|
|
drop table if exists t1,t2,t7,t8,t9;
|
|
drop database if exists mysqltest;
|
|
--enable_warnings
|
|
|
|
#
|
|
# First create little data to play with
|
|
#
|
|
|
|
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a));
|
|
create table t2 (a int not null auto_increment, b char(16) not null, primary key (a));
|
|
insert into t1 (b) values ("test"),("test1"),("test2"),("test3");
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
insert into t2 (b) select b from t1;
|
|
insert into t1 (b) select b from t2;
|
|
drop table t2;
|
|
|
|
#
|
|
# Start the test
|
|
# We use t9 here to not crash with tables generated by the backup test
|
|
#
|
|
|
|
disable_query_log;
|
|
eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam data directory="$MYSQL_TEST_DIR/var/tmp" index directory="$MYSQL_TEST_DIR/var/run";
|
|
enable_query_log;
|
|
|
|
insert into t9 select * from t1;
|
|
check table t9;
|
|
optimize table t9;
|
|
repair table t9;
|
|
alter table t9 add column c int not null;
|
|
--replace_result $MYSQL_TEST_DIR TEST_DIR
|
|
show create table t9;
|
|
|
|
# Test renames
|
|
alter table t9 rename t8, add column d int not null;
|
|
alter table t8 rename t7;
|
|
rename table t7 to t9;
|
|
# Drop old t1 table, keep t9
|
|
drop table t1;
|
|
|
|
#
|
|
# Test error handling
|
|
# Note that we are using the above table t9 here!
|
|
#
|
|
|
|
disable_query_log;
|
|
--error 1279,1279
|
|
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam data directory="tmp";
|
|
|
|
# Check that we cannot link over a table from another database.
|
|
|
|
create database mysqltest;
|
|
|
|
--error 1,1
|
|
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam index directory="/this-dir-does-not-exist";
|
|
|
|
--error 1279,1279
|
|
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam index directory="not-hard-path";
|
|
|
|
--error 1,1
|
|
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam index directory="$MYSQL_TEST_DIR/var/run";
|
|
|
|
--error 1,1
|
|
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam data directory="$MYSQL_TEST_DIR/var/tmp";
|
|
enable_query_log;
|
|
|
|
# Check moving table t9 from default database to mysqltest;
|
|
# In this case the symlinks should be removed.
|
|
|
|
alter table t9 rename mysqltest.t9;
|
|
select count(*) from mysqltest.t9;
|
|
--replace_result $MYSQL_TEST_DIR TEST_DIR
|
|
show create table mysqltest.t9;
|
|
drop database mysqltest;
|