summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2007-03-01 05:59:16 -0700
committerunknown <malff/marcsql@weblab.(none)>2007-03-01 05:59:16 -0700
commit71d12e9f318464f629536ea53353b2b648cc5744 (patch)
tree2d2131af539a07b992282de3f7d566ada6121247 /mysql-test/t
parent2e669d8e7b5944ad4a785ccd11424e060c5ce9bc (diff)
parent6e8be5380478aaad76f8553f80433737a9e63cec (diff)
downloadmariadb-git-71d12e9f318464f629536ea53353b2b648cc5744.tar.gz
Merge weblab.(none):/home/marcsql/TREE/mysql-4.1-base
into weblab.(none):/home/marcsql/TREE/mysql-4.1-runtime sql/sql_parse.cc: Auto merged
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/alter_table.test66
-rw-r--r--mysql-test/t/init_file.test9
2 files changed, 75 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 3e1e7952af1..52a569dfb57 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -518,4 +518,70 @@ SHOW INDEX FROM bug24219_2;
DROP TABLE bug24219_2;
+#
+# Bug#24562 (ALTER TABLE ... ORDER BY ... with complex expression asserts)
+#
+
+--disable_warnings
+drop table if exists table_24562;
+--enable_warnings
+
+create table table_24562(
+ section int,
+ subsection int,
+ title varchar(50));
+
+insert into table_24562 values
+(1, 0, "Introduction"),
+(1, 1, "Authors"),
+(1, 2, "Acknowledgements"),
+(2, 0, "Basics"),
+(2, 1, "Syntax"),
+(2, 2, "Client"),
+(2, 3, "Server"),
+(3, 0, "Intermediate"),
+(3, 1, "Complex queries"),
+(3, 2, "Stored Procedures"),
+(3, 3, "Stored Functions"),
+(4, 0, "Advanced"),
+(4, 1, "Replication"),
+(4, 2, "Load balancing"),
+(4, 3, "High availability"),
+(5, 0, "Conclusion");
+
+select * from table_24562;
+
+alter table table_24562 add column reviewer varchar(20),
+order by title;
+
+select * from table_24562;
+
+update table_24562 set reviewer="Me" where section=2;
+update table_24562 set reviewer="You" where section=3;
+
+alter table table_24562
+order by section ASC, subsection DESC;
+
+select * from table_24562;
+
+alter table table_24562
+order by table_24562.subsection ASC, table_24562.section DESC;
+
+select * from table_24562;
+
+--error 1064
+alter table table_24562 order by 12;
+--error 1064
+alter table table_24562 order by (section + 12);
+--error 1064
+alter table table_24562 order by length(title);
+--error 1064
+alter table table_24562 order by (select 12 from dual);
+
+--error 1054
+alter table table_24562 order by no_such_col;
+
+drop table table_24562;
+
# End of 4.1 tests
+
diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test
index bbe0c4ff884..34d738415c8 100644
--- a/mysql-test/t/init_file.test
+++ b/mysql-test/t/init_file.test
@@ -6,5 +6,14 @@
# mysql-test/t/init_file-master.opt for the actual test
#
+#
+# Bug#23240 --init-file statements with NOW() reports '1970-01-01 11:00:00'as the date time
+#
+INSERT INTO init_file.startup VALUES ( NOW() );
+SELECT * INTO @X FROM init_file.startup limit 0,1;
+SELECT * INTO @Y FROM init_file.startup limit 1,1;
+SELECT YEAR(@X)-YEAR(@Y);
+DROP DATABASE init_file;
+
--echo ok
--echo End of 4.1 tests