diff options
author | unknown <malff/marcsql@weblab.(none)> | 2007-01-18 18:43:11 -0700 |
---|---|---|
committer | unknown <malff/marcsql@weblab.(none)> | 2007-01-18 18:43:11 -0700 |
commit | f99f79179007da07b8290e025b88319f9a1fa20a (patch) | |
tree | 3d516d63da1b986006034e0eb7c84f9094673d14 /mysql-test/t/alter_table.test | |
parent | a7d2fa1413405358e5cccee73ab1d8019cb33378 (diff) | |
parent | 6c6a2785e9538363bba4d0eec1b1ad1c86c02cd0 (diff) | |
download | mariadb-git-f99f79179007da07b8290e025b88319f9a1fa20a.tar.gz |
Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-24562-merge
into weblab.(none):/home/marcsql/TREE/mysql-5.1-24562-merge
mysql-test/r/alter_table.result:
Auto merged
mysql-test/t/alter_table.test:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r-- | mysql-test/t/alter_table.test | 65 |
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 # |