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

« back to all changes in this revision

Viewing changes to mysql-test/t/alter_table.test

  • 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:
500
500
drop table t1;
501
501
 
502
502
#
 
503
# BUG#23404 - ROW_FORMAT=FIXED option is lost is an index is added to the
 
504
# table
 
505
#
 
506
CREATE TABLE t1(a INT) ROW_FORMAT=FIXED;
 
507
CREATE INDEX i1 ON t1(a);
 
508
SHOW CREATE TABLE t1;
 
509
DROP INDEX i1 ON t1;
 
510
SHOW CREATE TABLE t1;
 
511
DROP TABLE t1;
 
512
 
 
513
#
503
514
# Bug#24219 - ALTER TABLE ... RENAME TO ... , DISABLE KEYS leads to crash
504
515
#
505
516
--disable_warnings
517
528
 
518
529
DROP TABLE bug24219_2;
519
530
 
 
531
#
 
532
# Bug#24562 (ALTER TABLE ... ORDER BY ... with complex expression asserts)
 
533
#
 
534
 
 
535
--disable_warnings
 
536
drop table if exists table_24562;
 
537
--enable_warnings
 
538
 
 
539
create table table_24562(
 
540
  section int,
 
541
  subsection int,
 
542
  title varchar(50));
 
543
 
 
544
insert into table_24562 values
 
545
(1, 0, "Introduction"),
 
546
(1, 1, "Authors"),
 
547
(1, 2, "Acknowledgements"),
 
548
(2, 0, "Basics"),
 
549
(2, 1, "Syntax"),
 
550
(2, 2, "Client"),
 
551
(2, 3, "Server"),
 
552
(3, 0, "Intermediate"),
 
553
(3, 1, "Complex queries"),
 
554
(3, 2, "Stored Procedures"),
 
555
(3, 3, "Stored Functions"),
 
556
(4, 0, "Advanced"),
 
557
(4, 1, "Replication"),
 
558
(4, 2, "Load balancing"),
 
559
(4, 3, "High availability"),
 
560
(5, 0, "Conclusion");
 
561
 
 
562
select * from table_24562;
 
563
 
 
564
alter table table_24562 add column reviewer varchar(20),
 
565
order by title;
 
566
 
 
567
select * from table_24562;
 
568
 
 
569
update table_24562 set reviewer="Me" where section=2;
 
570
update table_24562 set reviewer="You" where section=3;
 
571
 
 
572
alter table table_24562
 
573
order by section ASC, subsection DESC;
 
574
 
 
575
select * from table_24562;
 
576
 
 
577
alter table table_24562
 
578
order by table_24562.subsection ASC, table_24562.section DESC;
 
579
 
 
580
select * from table_24562;
 
581
 
 
582
--error ER_PARSE_ERROR
 
583
alter table table_24562 order by 12;
 
584
--error ER_PARSE_ERROR
 
585
alter table table_24562 order by (section + 12);
 
586
--error ER_PARSE_ERROR
 
587
alter table table_24562 order by length(title);
 
588
--error ER_PARSE_ERROR
 
589
alter table table_24562 order by (select 12 from dual);
 
590
 
 
591
--error ER_BAD_FIELD_ERROR
 
592
alter table table_24562 order by no_such_col;
 
593
 
 
594
drop table table_24562;
 
595
 
520
596
# End of 4.1 tests
521
597
 
522
598
#