ps_5merge.test 2.57 KB
Newer Older
1 2 3 4 5 6
###############################################
#                                             #
#  Prepared Statements test on MERGE tables   #
#                                             #
###############################################

7 8 9 10
#    
# NOTE: PLEASE SEE ps_1general.test (bottom) 
#       BEFORE ADDING NEW TEST CASES HERE !!!

11 12 13 14
use test;

--disable_warnings
drop table if exists t1, t1_1, t1_2,
15
     t9, t9_1, t9_2;
16 17 18
--enable_warnings
let $type= 'MYISAM' ;
-- source include/ps_create.inc
19
rename table t1 to t1_1, t9 to t9_1 ;
20
-- source include/ps_create.inc
21
rename table t1 to t1_2, t9 to t9_2 ;
22 23 24 25 26 27 28

create table t1
(
  a int, b varchar(30),
  primary key(a)
) ENGINE = MERGE UNION=(t1_1,t1_2)
INSERT_METHOD=FIRST;
29
create table t9
30 31 32 33 34 35 36 37 38 39 40
(
  c1  tinyint, c2  smallint, c3  mediumint, c4  int,
  c5  integer, c6  bigint, c7  float, c8  double,
  c9  double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
  c13 date, c14 datetime, c15 timestamp(14), c16 time,
  c17 year, c18 bit, c19 bool, c20 char,
  c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
  c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
  c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
  c32 set('monday', 'tuesday', 'wednesday'),
  primary key(c1)
41
)  ENGINE = MERGE UNION=(t9_1,t9_2)
42 43 44 45 46 47 48 49
INSERT_METHOD=FIRST;
-- source include/ps_renew.inc

-- source include/ps_query.inc
-- source include/ps_modify.inc
# no test of ps_modify1, because insert .. select 
# is not allowed on MERGE tables
# -- source include/ps_modify1.inc
50
-- source include/ps_conv.inc
51 52

# Lets's try the same tests with INSERT_METHOD=LAST
53
drop table t1, t9 ;
54 55 56 57 58 59
create table t1
(
  a int, b varchar(30),
  primary key(a)
) ENGINE = MERGE UNION=(t1_1,t1_2)
INSERT_METHOD=LAST;
60
create table t9
61 62 63 64 65 66 67 68 69 70 71
(
  c1  tinyint, c2  smallint, c3  mediumint, c4  int,
  c5  integer, c6  bigint, c7  float, c8  double,
  c9  double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
  c13 date, c14 datetime, c15 timestamp(14), c16 time,
  c17 year, c18 bit, c19 bool, c20 char,
  c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
  c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
  c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
  c32 set('monday', 'tuesday', 'wednesday'),
  primary key(c1)
72
)  ENGINE = MERGE UNION=(t9_1,t9_2)
73 74 75 76 77 78 79 80
INSERT_METHOD=LAST;
-- source include/ps_renew.inc

-- source include/ps_query.inc
-- source include/ps_modify.inc
# no test of ps_modify1, because insert .. select
# is not allowed on MERGE tables
# -- source include/ps_modify1.inc
81
-- source include/ps_conv.inc
82 83

drop table t1, t1_1, t1_2, 
84
           t9_1, t9_2, t9;