MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
loaddata_autocom.inc
1 # Test if the engine does autocommit in LOAD DATA INFILE, or not
2 # (NDB wants to do, others don't).
3 
4 eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
5 
6 --disable_warnings
7 drop table if exists t1;
8 --enable_warnings
9 
10 let $load_file= $MYSQLTEST_VARDIR/std_data/loaddata2.dat;
11 
12 # NDB does not support the create option 'Binlog of table with BLOB attribute and no PK'
13 # So use a dummy PK here.
14 create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
15 start transaction;
16 --replace_result $load_file LOAD_FILE
17 eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
18 commit;
19 select count(*) from t1;
20 truncate table t1;
21 start transaction;
22 --replace_result $load_file LOAD_FILE
23 eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
24 rollback;
25 select count(*) from t1;
26 
27 drop table t1;