Commit 102c4777 authored by monty@narttu.mysql.fi's avatar monty@narttu.mysql.fi

Added testing of LOAD DATA ... STARTING BY

Added read_only variable
parent fc0df599
...@@ -8,4 +8,11 @@ a b c d ...@@ -8,4 +8,11 @@ a b c d
0000-00-00 0000-00-00 0000-00-00 0000-00-00 0000-00-00 0000-00-00 0000-00-00 0000-00-00
2003-03-03 2003-03-03 2003-03-03 NULL 2003-03-03 2003-03-03 2003-03-03 NULL
2003-03-03 2003-03-03 2003-03-03 NULL 2003-03-03 2003-03-03 2003-03-03 NULL
truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
SELECT * from t1;
a b c d
NULL NULL 0000-00-00 0000-00-00
NULL 0000-00-00 0000-00-00 0000-00-00
NULL 2003-03-03 2003-03-03 NULL
drop table t1; drop table t1;
...@@ -8,4 +8,12 @@ create table t1 (a date, b date, c date not null, d date); ...@@ -8,4 +8,12 @@ create table t1 (a date, b date, c date not null, d date);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
SELECT * from t1; SELECT * from t1;
truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
SELECT * from t1;
drop table t1; drop table t1;
...@@ -1946,8 +1946,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, ...@@ -1946,8 +1946,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
sql_error= ER_UNKNOWN_ERROR; sql_error= ER_UNKNOWN_ERROR;
slave_print_error(rli,sql_error, slave_print_error(rli,sql_error,
"Error '%s' running load data infile", "Error '%s' running load data infile",
sql_error ? thd->net.last_error : ER_SAFE(sql_error));
ER_SAFE(ER_UNKNOWN_ERROR));
free_root(&thd->mem_root,0); free_root(&thd->mem_root,0);
return 1; return 1;
} }
......
...@@ -185,6 +185,7 @@ sys_var_thd_ulong sys_net_retry_count("net_retry_count", ...@@ -185,6 +185,7 @@ sys_var_thd_ulong sys_net_retry_count("net_retry_count",
sys_var_thd_bool sys_new_mode("new", &SV::new_mode); sys_var_thd_bool sys_new_mode("new", &SV::new_mode);
sys_var_thd_ulong sys_read_buff_size("read_buffer_size", sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
&SV::read_buff_size); &SV::read_buff_size);
sys_var_bool_ptr sys_readonly("read_only", &opt_readonly);
sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size", sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size",
&SV::read_rnd_buff_size); &SV::read_rnd_buff_size);
sys_var_long_ptr sys_rpl_recovery_rank("rpl_recovery_rank", sys_var_long_ptr sys_rpl_recovery_rank("rpl_recovery_rank",
...@@ -204,8 +205,6 @@ sys_var_bool_ptr sys_slave_compressed_protocol("slave_compressed_protocol", ...@@ -204,8 +205,6 @@ sys_var_bool_ptr sys_slave_compressed_protocol("slave_compressed_protocol",
&opt_slave_compressed_protocol); &opt_slave_compressed_protocol);
sys_var_long_ptr sys_slave_net_timeout("slave_net_timeout", sys_var_long_ptr sys_slave_net_timeout("slave_net_timeout",
&slave_net_timeout); &slave_net_timeout);
sys_var_bool_ptr sys_readonly("read_only",
&opt_readonly);
sys_var_long_ptr sys_slow_launch_time("slow_launch_time", sys_var_long_ptr sys_slow_launch_time("slow_launch_time",
&slow_launch_time); &slow_launch_time);
sys_var_thd_ulong sys_sort_buffer("sort_buffer_size", sys_var_thd_ulong sys_sort_buffer("sort_buffer_size",
...@@ -516,6 +515,7 @@ struct show_var_st init_vars[]= { ...@@ -516,6 +515,7 @@ struct show_var_st init_vars[]= {
{"port", (char*) &mysql_port, SHOW_INT}, {"port", (char*) &mysql_port, SHOW_INT},
{"protocol_version", (char*) &protocol_version, SHOW_INT}, {"protocol_version", (char*) &protocol_version, SHOW_INT},
{sys_read_buff_size.name, (char*) &sys_read_buff_size, SHOW_SYS}, {sys_read_buff_size.name, (char*) &sys_read_buff_size, SHOW_SYS},
{sys_readonly.name, (char*) &sys_readonly, SHOW_SYS},
{sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size, SHOW_SYS}, {sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size, SHOW_SYS},
{sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank, SHOW_SYS}, {sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank, SHOW_SYS},
#ifdef HAVE_QUERY_CACHE #ifdef HAVE_QUERY_CACHE
...@@ -525,7 +525,6 @@ struct show_var_st init_vars[]= { ...@@ -525,7 +525,6 @@ struct show_var_st init_vars[]= {
#endif /* HAVE_QUERY_CACHE */ #endif /* HAVE_QUERY_CACHE */
{sys_server_id.name, (char*) &sys_server_id, SHOW_SYS}, {sys_server_id.name, (char*) &sys_server_id, SHOW_SYS},
{sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS}, {sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS},
{sys_readonly.name, (char*) &sys_readonly, SHOW_SYS},
{"skip_external_locking", (char*) &my_disable_locking, SHOW_MY_BOOL}, {"skip_external_locking", (char*) &my_disable_locking, SHOW_MY_BOOL},
{"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL}, {"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL},
{"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL}, {"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
......
...@@ -182,7 +182,6 @@ int mysql_update(THD *thd, ...@@ -182,7 +182,6 @@ int mysql_update(THD *thd,
*/ */
uint length; uint length;
SORT_FIELD *sortorder; SORT_FIELD *sortorder;
List<Item> fields;
ha_rows examined_rows; ha_rows examined_rows;
table->io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE), table->io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment