~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to tests/auto_increment.tst

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Test of auto_increment
 
3
#
 
4
# run this program with mysql -vvf test < this file
 
5
 
 
6
drop table if exists auto_incr_test,auto_incr_test2 ;
 
7
 
 
8
create table auto_incr_test (id int not null auto_increment, name char(40), timestamp timestamp, primary key (id)) ;
 
9
 
 
10
insert into auto_incr_test (name) values ("first record");
 
11
insert into auto_incr_test values (last_insert_id()+1,"second record",null);
 
12
insert into auto_incr_test (id,name) values (10,"tenth record");
 
13
insert into auto_incr_test values (0,"eleventh record",null);
 
14
insert into auto_incr_test values (last_insert_id()+1,"12","1997-01-01");
 
15
insert into auto_incr_test values (12,"this will not work",NULL);
 
16
replace into auto_incr_test values (12,"twelfth record",NULL);
 
17
 
 
18
select * from auto_incr_test ;
 
19
 
 
20
create table auto_incr_test2 (id int not null auto_increment, name char(40), primary key (id)) ;
 
21
insert into auto_incr_test2 select NULL,name from auto_incr_test;
 
22
insert into auto_incr_test2 select id,name from auto_incr_test;
 
23
replace into auto_incr_test2 select id,name from auto_incr_test;
 
24
 
 
25
select * from auto_incr_test2 ;
 
26
 
 
27
drop table auto_incr_test,auto_incr_test2;