Commit 5cf4eb0e authored by ramil@mysql.com's avatar ramil@mysql.com

Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1

into  mysql.com:/usr/home/ram/work/4.1.b11553
parents 92306dd0 47807ba5
...@@ -66,3 +66,13 @@ a b ...@@ -66,3 +66,13 @@ a b
3 row 3 3 row 3
0 0
drop table t1; drop table t1;
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
create table t1(id integer not null auto_increment primary key);
insert into t1 values(0);
select * from t1;
id
0
select * from t1;
id
0
SET @@SQL_MODE=@OLD_SQL_MODE;
...@@ -200,3 +200,119 @@ a ...@@ -200,3 +200,119 @@ a
drop table t4; drop table t4;
show tables; show tables;
Tables_in_test Tables_in_test
create table t1 (
ai bigint auto_increment,
c001 int(11) not null,
c002 int(11) not null,
c003 int(11) not null,
c004 int(11) not null,
c005 int(11) not null,
c006 int(11) not null,
c007 int(11) not null,
c008 int(11) not null,
c009 int(11) not null,
c010 int(11) not null,
c011 int(11) not null,
c012 int(11) not null,
c013 int(11) not null,
c014 int(11) not null,
c015 int(11) not null,
c016 int(11) not null,
c017 int(11) not null,
c018 int(11) not null,
c019 int(11) not null,
c020 int(11) not null,
c021 int(11) not null,
c022 int(11) not null,
c023 int(11) not null,
c024 int(11) not null,
c025 int(11) not null,
c026 int(11) not null,
c027 int(11) not null,
c028 int(11) not null,
c029 int(11) not null,
c030 int(11) not null,
c031 int(11) not null,
c032 int(11) not null,
c033 int(11) not null,
c034 int(11) not null,
c035 int(11) not null,
c036 int(11) not null,
c037 int(11) not null,
c038 int(11) not null,
c039 int(11) not null,
c040 int(11) not null,
c041 int(11) not null,
c042 int(11) not null,
c043 int(11) not null,
c044 int(11) not null,
c045 int(11) not null,
c046 int(11) not null,
c047 int(11) not null,
c048 int(11) not null,
c049 int(11) not null,
c050 int(11) not null,
c051 int(11) not null,
c052 int(11) not null,
c053 int(11) not null,
c054 int(11) not null,
c055 int(11) not null,
c056 int(11) not null,
c057 int(11) not null,
c058 int(11) not null,
c059 int(11) not null,
c060 int(11) not null,
c061 int(11) not null,
c062 int(11) not null,
c063 int(11) not null,
c064 int(11) not null,
c065 int(11) not null,
c066 int(11) not null,
c067 int(11) not null,
c068 int(11) not null,
c069 int(11) not null,
c070 int(11) not null,
c071 int(11) not null,
c072 int(11) not null,
c073 int(11) not null,
c074 int(11) not null,
c075 int(11) not null,
c076 int(11) not null,
c077 int(11) not null,
c078 int(11) not null,
c079 int(11) not null,
c080 int(11) not null,
c081 int(11) not null,
c082 int(11) not null,
c083 int(11) not null,
c084 int(11) not null,
c085 int(11) not null,
c086 int(11) not null,
c087 int(11) not null,
c088 int(11) not null,
c089 int(11) not null,
c090 int(11) not null,
c091 int(11) not null,
c092 int(11) not null,
c093 int(11) not null,
c094 int(11) not null,
c095 int(11) not null,
c096 int(11) not null,
c097 int(11) not null,
c098 int(11) not null,
c099 int(11) not null,
c100 int(11) not null,
c101 int(11) not null,
c102 int(11) not null,
c103 int(11) not null,
c104 int(11) not null,
c105 int(11) not null,
c106 int(11) not null,
c107 int(11) not null,
c108 int(11) not null,
c109 int(11) not null,
primary key (ai),
unique key tx1 (c002, c003, c004, c005)) engine=ndb;
create index tx2
on t1 (c010, c011, c012, c013);
drop table t1;
...@@ -31,4 +31,31 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated ...@@ -31,4 +31,31 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated
select * from t1; select * from t1;
drop table t1; drop table t1;
#
# Bug #12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting
#
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
create table t1(id integer not null auto_increment primary key);
insert into t1 values(0);
disable_query_log;
eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' from t1;
delete from t1;
eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1;
enable_query_log;
select * from t1;
--exec rm $MYSQL_TEST_DIR/var/tmp/t1
disable_query_log;
eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1'
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
FROM t1;
delete from t1;
eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
enable_query_log;
select * from t1;
--exec rm $MYSQL_TEST_DIR/var/tmp/t1
SET @@SQL_MODE=@OLD_SQL_MODE;
# End of 4.1 tests # End of 4.1 tests
...@@ -199,4 +199,123 @@ drop table t4; ...@@ -199,4 +199,123 @@ drop table t4;
show tables; show tables;
connection server1; connection server1;
create table t1 (
ai bigint auto_increment,
c001 int(11) not null,
c002 int(11) not null,
c003 int(11) not null,
c004 int(11) not null,
c005 int(11) not null,
c006 int(11) not null,
c007 int(11) not null,
c008 int(11) not null,
c009 int(11) not null,
c010 int(11) not null,
c011 int(11) not null,
c012 int(11) not null,
c013 int(11) not null,
c014 int(11) not null,
c015 int(11) not null,
c016 int(11) not null,
c017 int(11) not null,
c018 int(11) not null,
c019 int(11) not null,
c020 int(11) not null,
c021 int(11) not null,
c022 int(11) not null,
c023 int(11) not null,
c024 int(11) not null,
c025 int(11) not null,
c026 int(11) not null,
c027 int(11) not null,
c028 int(11) not null,
c029 int(11) not null,
c030 int(11) not null,
c031 int(11) not null,
c032 int(11) not null,
c033 int(11) not null,
c034 int(11) not null,
c035 int(11) not null,
c036 int(11) not null,
c037 int(11) not null,
c038 int(11) not null,
c039 int(11) not null,
c040 int(11) not null,
c041 int(11) not null,
c042 int(11) not null,
c043 int(11) not null,
c044 int(11) not null,
c045 int(11) not null,
c046 int(11) not null,
c047 int(11) not null,
c048 int(11) not null,
c049 int(11) not null,
c050 int(11) not null,
c051 int(11) not null,
c052 int(11) not null,
c053 int(11) not null,
c054 int(11) not null,
c055 int(11) not null,
c056 int(11) not null,
c057 int(11) not null,
c058 int(11) not null,
c059 int(11) not null,
c060 int(11) not null,
c061 int(11) not null,
c062 int(11) not null,
c063 int(11) not null,
c064 int(11) not null,
c065 int(11) not null,
c066 int(11) not null,
c067 int(11) not null,
c068 int(11) not null,
c069 int(11) not null,
c070 int(11) not null,
c071 int(11) not null,
c072 int(11) not null,
c073 int(11) not null,
c074 int(11) not null,
c075 int(11) not null,
c076 int(11) not null,
c077 int(11) not null,
c078 int(11) not null,
c079 int(11) not null,
c080 int(11) not null,
c081 int(11) not null,
c082 int(11) not null,
c083 int(11) not null,
c084 int(11) not null,
c085 int(11) not null,
c086 int(11) not null,
c087 int(11) not null,
c088 int(11) not null,
c089 int(11) not null,
c090 int(11) not null,
c091 int(11) not null,
c092 int(11) not null,
c093 int(11) not null,
c094 int(11) not null,
c095 int(11) not null,
c096 int(11) not null,
c097 int(11) not null,
c098 int(11) not null,
c099 int(11) not null,
c100 int(11) not null,
c101 int(11) not null,
c102 int(11) not null,
c103 int(11) not null,
c104 int(11) not null,
c105 int(11) not null,
c106 int(11) not null,
c107 int(11) not null,
c108 int(11) not null,
c109 int(11) not null,
primary key (ai),
unique key tx1 (c002, c003, c004, c005)) engine=ndb;
create index tx2
on t1 (c010, c011, c012, c013);
drop table t1;
# End of 4.1 tests # End of 4.1 tests
...@@ -3036,7 +3036,7 @@ Dbdict::alterTable_backup_mutex_locked(Signal* signal, ...@@ -3036,7 +3036,7 @@ Dbdict::alterTable_backup_mutex_locked(Signal* signal,
lreq->gci = tablePtr.p->gciTableCreated; lreq->gci = tablePtr.p->gciTableCreated;
lreq->requestType = AlterTabReq::AlterTablePrepare; lreq->requestType = AlterTabReq::AlterTablePrepare;
sendSignal(rg, GSN_ALTER_TAB_REQ, signal, sendFragmentedSignal(rg, GSN_ALTER_TAB_REQ, signal,
AlterTabReq::SignalLength, JBB); AlterTabReq::SignalLength, JBB);
} }
...@@ -3521,7 +3521,7 @@ Dbdict::execALTER_TAB_CONF(Signal * signal){ ...@@ -3521,7 +3521,7 @@ Dbdict::execALTER_TAB_CONF(Signal * signal){
lreq->gci = gci; lreq->gci = gci;
lreq->requestType = AlterTabReq::AlterTableCommit; lreq->requestType = AlterTabReq::AlterTableCommit;
sendSignal(rg, GSN_ALTER_TAB_REQ, signal, sendFragmentedSignal(rg, GSN_ALTER_TAB_REQ, signal,
AlterTabReq::SignalLength, JBB); AlterTabReq::SignalLength, JBB);
} }
} }
......
...@@ -429,6 +429,8 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List<Item> &fields, ...@@ -429,6 +429,8 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List<Item> &fields,
while ((sql_field= (Item_field*) it++)) while ((sql_field= (Item_field*) it++))
{ {
Field *field= sql_field->field; Field *field= sql_field->field;
if (field == table->next_number_field)
table->auto_increment_field_not_null= TRUE;
if (pos == read_info.row_end) if (pos == read_info.row_end)
{ {
thd->cuted_fields++; /* Not enough fields */ thd->cuted_fields++; /* Not enough fields */
...@@ -520,6 +522,8 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, ...@@ -520,6 +522,8 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table,
length=(uint) (read_info.row_end-pos); length=(uint) (read_info.row_end-pos);
Field *field=sql_field->field; Field *field=sql_field->field;
if (field == table->next_number_field)
table->auto_increment_field_not_null= TRUE;
if (!read_info.enclosed && if (!read_info.enclosed &&
(enclosed_length && length == 4 && !memcmp(pos,"NULL",4)) || (enclosed_length && length == 4 && !memcmp(pos,"NULL",4)) ||
(length == 1 && read_info.found_null)) (length == 1 && read_info.found_null))
......
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