summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authormalff/marcsql@weblab.(none) <>2007-01-18 18:43:11 -0700
committermalff/marcsql@weblab.(none) <>2007-01-18 18:43:11 -0700
commita0c1c61b1fa4024ea66c3d757ba5a2740e2bb034 (patch)
tree3d516d63da1b986006034e0eb7c84f9094673d14 /mysql-test/t/alter_table.test
parentca77918d92c0662681fd2f4de7b99b9d3dc22515 (diff)
parent4064c89d2400a910e24813ce633f5c9522d1a321 (diff)
downloadmariadb-git-a0c1c61b1fa4024ea66c3d757ba5a2740e2bb034.tar.gz
Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-24562-merge
into weblab.(none):/home/marcsql/TREE/mysql-5.1-24562-merge
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test65
1 files changed, 65 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 990f0f4adf5..297813dfead 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -528,6 +528,71 @@ 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 ER_PARSE_ERROR
+alter table table_24562 order by 12;
+--error ER_PARSE_ERROR
+alter table table_24562 order by (section + 12);
+--error ER_PARSE_ERROR
+alter table table_24562 order by length(title);
+--error ER_PARSE_ERROR
+alter table table_24562 order by (select 12 from dual);
+
+--error ER_BAD_FIELD_ERROR
+alter table table_24562 order by no_such_col;
+
+drop table table_24562;
+
# End of 4.1 tests
#