677
677
alter table test.t1 rename test.t1;
680
CREATE TABLE t1(a INT) ROW_FORMAT=FIXED;
681
CREATE INDEX i1 ON t1(a);
682
SHOW CREATE TABLE t1;
684
t1 CREATE TABLE `t1` (
685
`a` int(11) default NULL,
687
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
689
SHOW CREATE TABLE t1;
691
t1 CREATE TABLE `t1` (
692
`a` int(11) default NULL
693
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
680
695
DROP TABLE IF EXISTS bug24219;
681
696
DROP TABLE IF EXISTS bug24219_2;
682
697
CREATE TABLE bug24219 (a INT, INDEX(a));
688
703
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
689
704
bug24219_2 1 a 1 a A NULL NULL NULL YES BTREE disabled
690
705
DROP TABLE bug24219_2;
706
drop table if exists table_24562;
707
create table table_24562(
711
insert into table_24562 values
712
(1, 0, "Introduction"),
714
(1, 2, "Acknowledgements"),
719
(3, 0, "Intermediate"),
720
(3, 1, "Complex queries"),
721
(3, 2, "Stored Procedures"),
722
(3, 3, "Stored Functions"),
724
(4, 1, "Replication"),
725
(4, 2, "Load balancing"),
726
(4, 3, "High availability"),
727
(5, 0, "Conclusion");
728
select * from table_24562;
729
section subsection title
739
3 2 Stored Procedures
744
4 3 High availability
746
alter table table_24562 add column reviewer varchar(20),
748
select * from table_24562;
749
section subsection title reviewer
750
1 2 Acknowledgements NULL
755
3 1 Complex queries NULL
757
4 3 High availability NULL
758
3 0 Intermediate NULL
759
1 0 Introduction NULL
760
4 2 Load balancing NULL
763
3 3 Stored Functions NULL
764
3 2 Stored Procedures NULL
766
update table_24562 set reviewer="Me" where section=2;
767
update table_24562 set reviewer="You" where section=3;
768
alter table table_24562
769
order by section ASC, subsection DESC;
770
select * from table_24562;
771
section subsection title reviewer
772
1 2 Acknowledgements NULL
774
1 0 Introduction NULL
779
3 3 Stored Functions You
780
3 2 Stored Procedures You
781
3 1 Complex queries You
783
4 3 High availability NULL
784
4 2 Load balancing NULL
788
alter table table_24562
789
order by table_24562.subsection ASC, table_24562.section DESC;
790
select * from table_24562;
791
section subsection title reviewer
796
1 0 Introduction NULL
798
3 1 Complex queries You
801
4 2 Load balancing NULL
802
3 2 Stored Procedures You
804
1 2 Acknowledgements NULL
805
4 3 High availability NULL
806
3 3 Stored Functions You
808
alter table table_24562 order by 12;
809
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 '12' at line 1
810
alter table table_24562 order by (section + 12);
811
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 '(section + 12)' at line 1
812
alter table table_24562 order by length(title);
813
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 'length(title)' at line 1
814
alter table table_24562 order by (select 12 from dual);
815
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 '(select 12 from dual)' at line 1
816
alter table table_24562 order by no_such_col;
817
ERROR 42S22: Unknown column 'no_such_col' in 'order clause'
818
drop table table_24562;
691
819
create table t1 (mycol int(10) not null);
692
820
alter table t1 alter column mycol set default 0;