Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
26d2908c
Commit
26d2908c
authored
Apr 09, 2007
by
holyfoot/hf@hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into mysql.com:/d2/hf/mrg/mysql-5.1-opt
parents
87daef26
bd461b01
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
7 deletions
+33
-7
mysql-test/r/loaddata.result
mysql-test/r/loaddata.result
+9
-0
mysql-test/t/loaddata.test
mysql-test/t/loaddata.test
+16
-0
sql/sql_load.cc
sql/sql_load.cc
+8
-7
No files found.
mysql-test/r/loaddata.result
View file @
26d2908c
...
@@ -165,6 +165,15 @@ select load_file("MYSQL_TEST_DIR/t/loaddata.test");
...
@@ -165,6 +165,15 @@ select load_file("MYSQL_TEST_DIR/t/loaddata.test");
load_file("MYSQL_TEST_DIR/t/loaddata.test")
load_file("MYSQL_TEST_DIR/t/loaddata.test")
NULL
NULL
drop table t1, t2;
drop table t1, t2;
create table t1(f1 int);
insert into t1 values(1),(null);
create table t2(f2 int auto_increment primary key);
select * from t2;
f2
1
2
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1,t2;
CREATE TABLE t1 (a int);
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
SET NAMES latin1;
SET NAMES latin1;
...
...
mysql-test/t/loaddata.test
View file @
26d2908c
...
@@ -140,6 +140,22 @@ eval select load_file("$MYSQL_TEST_DIR/t/loaddata.test");
...
@@ -140,6 +140,22 @@ eval select load_file("$MYSQL_TEST_DIR/t/loaddata.test");
# cleanup
# cleanup
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug#27586: Wrong autoinc value assigned by LOAD DATA in the
# NO_AUTO_VALUE_ON_ZERO mode
#
create
table
t1
(
f1
int
);
insert
into
t1
values
(
1
),(
null
);
create
table
t2
(
f2
int
auto_increment
primary
key
);
disable_query_log
;
eval
select
*
into
outfile
'$MYSQLTEST_VARDIR/tmp/t1'
from
t1
;
SET
@
OLD_SQL_MODE
=@@
SQL_MODE
,
@@
SQL_MODE
=
NO_AUTO_VALUE_ON_ZERO
;
eval
load
data
infile
'$MYSQLTEST_VARDIR/tmp/t1'
into
table
t2
;
enable_query_log
;
select
*
from
t2
;
--
exec
rm
$MYSQLTEST_VARDIR
/
tmp
/
t1
SET
@@
SQL_MODE
=@
OLD_SQL_MODE
;
drop
table
t1
,
t2
;
# End of 5.0 tests
# End of 5.0 tests
...
...
sql/sql_load.cc
View file @
26d2908c
...
@@ -552,7 +552,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
...
@@ -552,7 +552,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
Item_field
*
sql_field
;
Item_field
*
sql_field
;
TABLE
*
table
=
table_list
->
table
;
TABLE
*
table
=
table_list
->
table
;
ulonglong
id
;
ulonglong
id
;
bool
no_trans_update
;
bool
no_trans_update
,
err
;
DBUG_ENTER
(
"read_fixed_length"
);
DBUG_ENTER
(
"read_fixed_length"
);
id
=
0
;
id
=
0
;
...
@@ -644,7 +644,9 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
...
@@ -644,7 +644,9 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
if
(
write_record
(
thd
,
table
,
&
info
))
err
=
write_record
(
thd
,
table
,
&
info
);
table
->
auto_increment_field_not_null
=
FALSE
;
if
(
err
)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
thd
->
no_trans_update
=
no_trans_update
;
thd
->
no_trans_update
=
no_trans_update
;
...
@@ -681,7 +683,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
...
@@ -681,7 +683,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
TABLE
*
table
=
table_list
->
table
;
TABLE
*
table
=
table_list
->
table
;
uint
enclosed_length
;
uint
enclosed_length
;
ulonglong
id
;
ulonglong
id
;
bool
no_trans_update
;
bool
no_trans_update
,
err
;
DBUG_ENTER
(
"read_sep_field"
);
DBUG_ENTER
(
"read_sep_field"
);
enclosed_length
=
enclosed
.
length
();
enclosed_length
=
enclosed
.
length
();
...
@@ -728,8 +730,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
...
@@ -728,8 +730,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
field
->
set_null
();
field
->
set_null
();
if
(
field
==
table
->
next_number_field
)
table
->
auto_increment_field_not_null
=
TRUE
;
if
(
!
field
->
maybe_null
())
if
(
!
field
->
maybe_null
())
{
{
if
(
field
->
type
()
==
MYSQL_TYPE_TIMESTAMP
)
if
(
field
->
type
()
==
MYSQL_TYPE_TIMESTAMP
)
...
@@ -815,8 +815,9 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
...
@@ -815,8 +815,9 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
err
=
write_record
(
thd
,
table
,
&
info
);
if
(
write_record
(
thd
,
table
,
&
info
))
table
->
auto_increment_field_not_null
=
FALSE
;
if
(
err
)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
/*
/*
We don't need to reset auto-increment field since we are restoring
We don't need to reset auto-increment field since we are restoring
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment