~ubuntu-branches/ubuntu/hardy/mysql-dfsg-5.0/hardy-updates

« back to all changes in this revision

Viewing changes to mysql-test/r/alter_table.result

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-04-02 16:10:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070402161053-zkil9hjq9k5p1uzv
Tags: 5.0.37-0ubuntu1
* New upstream bugfix release.
  - Fixes replication failure with auto-increment and on duplicate key
    update, a regression introduced into 5.0.24. (LP: #95821)
* debian/control: Set Ubuntu maintainer.
* debian/rules: Change comments from 'Debian etch' to 'Ubuntu 7.04'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
677
677
alter table test.t1 rename test.t1;
678
678
use test;
679
679
drop table t1;
 
680
CREATE TABLE t1(a INT) ROW_FORMAT=FIXED;
 
681
CREATE INDEX i1 ON t1(a);
 
682
SHOW CREATE TABLE t1;
 
683
Table   Create Table
 
684
t1      CREATE TABLE `t1` (
 
685
  `a` int(11) default NULL,
 
686
  KEY `i1` (`a`)
 
687
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
 
688
DROP INDEX i1 ON t1;
 
689
SHOW CREATE TABLE t1;
 
690
Table   Create Table
 
691
t1      CREATE TABLE `t1` (
 
692
  `a` int(11) default NULL
 
693
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
 
694
DROP TABLE t1;
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(
 
708
section int,
 
709
subsection int,
 
710
title varchar(50));
 
711
insert into table_24562 values
 
712
(1, 0, "Introduction"),
 
713
(1, 1, "Authors"),
 
714
(1, 2, "Acknowledgements"),
 
715
(2, 0, "Basics"),
 
716
(2, 1, "Syntax"),
 
717
(2, 2, "Client"),
 
718
(2, 3, "Server"),
 
719
(3, 0, "Intermediate"),
 
720
(3, 1, "Complex queries"),
 
721
(3, 2, "Stored Procedures"),
 
722
(3, 3, "Stored Functions"),
 
723
(4, 0, "Advanced"),
 
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
 
730
1       0       Introduction
 
731
1       1       Authors
 
732
1       2       Acknowledgements
 
733
2       0       Basics
 
734
2       1       Syntax
 
735
2       2       Client
 
736
2       3       Server
 
737
3       0       Intermediate
 
738
3       1       Complex queries
 
739
3       2       Stored Procedures
 
740
3       3       Stored Functions
 
741
4       0       Advanced
 
742
4       1       Replication
 
743
4       2       Load balancing
 
744
4       3       High availability
 
745
5       0       Conclusion
 
746
alter table table_24562 add column reviewer varchar(20),
 
747
order by title;
 
748
select * from table_24562;
 
749
section subsection      title   reviewer
 
750
1       2       Acknowledgements        NULL
 
751
4       0       Advanced        NULL
 
752
1       1       Authors NULL
 
753
2       0       Basics  NULL
 
754
2       2       Client  NULL
 
755
3       1       Complex queries NULL
 
756
5       0       Conclusion      NULL
 
757
4       3       High availability       NULL
 
758
3       0       Intermediate    NULL
 
759
1       0       Introduction    NULL
 
760
4       2       Load balancing  NULL
 
761
4       1       Replication     NULL
 
762
2       3       Server  NULL
 
763
3       3       Stored Functions        NULL
 
764
3       2       Stored Procedures       NULL
 
765
2       1       Syntax  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
 
773
1       1       Authors NULL
 
774
1       0       Introduction    NULL
 
775
2       3       Server  Me
 
776
2       2       Client  Me
 
777
2       1       Syntax  Me
 
778
2       0       Basics  Me
 
779
3       3       Stored Functions        You
 
780
3       2       Stored Procedures       You
 
781
3       1       Complex queries You
 
782
3       0       Intermediate    You
 
783
4       3       High availability       NULL
 
784
4       2       Load balancing  NULL
 
785
4       1       Replication     NULL
 
786
4       0       Advanced        NULL
 
787
5       0       Conclusion      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
 
792
5       0       Conclusion      NULL
 
793
4       0       Advanced        NULL
 
794
3       0       Intermediate    You
 
795
2       0       Basics  Me
 
796
1       0       Introduction    NULL
 
797
4       1       Replication     NULL
 
798
3       1       Complex queries You
 
799
2       1       Syntax  Me
 
800
1       1       Authors NULL
 
801
4       2       Load balancing  NULL
 
802
3       2       Stored Procedures       You
 
803
2       2       Client  Me
 
804
1       2       Acknowledgements        NULL
 
805
4       3       High availability       NULL
 
806
3       3       Stored Functions        You
 
807
2       3       Server  Me
 
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;
693
821
desc t1;