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
e4af9fc7
Commit
e4af9fc7
authored
May 08, 2007
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/mysql-5.1-opt
parents
fea4af6d
b45ef06e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
0 deletions
+49
-0
mysql-test/r/loaddata.result
mysql-test/r/loaddata.result
+19
-0
mysql-test/t/loaddata.test
mysql-test/t/loaddata.test
+26
-0
sql/sql_load.cc
sql/sql_load.cc
+4
-0
No files found.
mysql-test/r/loaddata.result
View file @
e4af9fc7
...
@@ -174,6 +174,25 @@ f2
...
@@ -174,6 +174,25 @@ f2
2
2
SET @@SQL_MODE=@OLD_SQL_MODE;
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1,t2;
drop table t1,t2;
create table t1(f1 int, f2 timestamp not null default current_timestamp);
create table t2(f1 int);
insert into t2 values(1),(2);
Warnings:
Warning 1261 Row 1 doesn't contain data for all columns
Warning 1261 Row 2 doesn't contain data for all columns
select f1 from t1 where f2 <> '0000-00-00 00:00:00';
f1
1
2
delete from t1;
Warnings:
Warning 1261 Row 1 doesn't contain data for all columns
Warning 1261 Row 2 doesn't contain data for all columns
select f1 from t1 where f2 <> '0000-00-00 00:00:00';
f1
1
2
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 @
e4af9fc7
...
@@ -156,6 +156,32 @@ select * from t2;
...
@@ -156,6 +156,32 @@ select * from t2;
--
exec
rm
$MYSQLTEST_VARDIR
/
tmp
/
t1
--
exec
rm
$MYSQLTEST_VARDIR
/
tmp
/
t1
SET
@@
SQL_MODE
=@
OLD_SQL_MODE
;
SET
@@
SQL_MODE
=@
OLD_SQL_MODE
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP default value for a
# TIMESTAMP field when no value has been provided.
#
create
table
t1
(
f1
int
,
f2
timestamp
not
null
default
current_timestamp
);
create
table
t2
(
f1
int
);
insert
into
t2
values
(
1
),(
2
);
disable_query_log
;
eval
select
*
into
outfile
'$MYSQLTEST_VARDIR/tmp/t2'
from
t2
;
eval
load
data
infile
'$MYSQLTEST_VARDIR/tmp/t2'
into
table
t1
;
enable_query_log
;
select
f1
from
t1
where
f2
<>
'0000-00-00 00:00:00'
;
--
exec
rm
$MYSQLTEST_VARDIR
/
tmp
/
t2
delete
from
t1
;
disable_query_log
;
eval
SELECT
*
INTO
OUTFILE
'$MYSQLTEST_VARDIR/tmp/t2'
FIELDS
TERMINATED
BY
''
OPTIONALLY
ENCLOSED
BY
''
LINES
TERMINATED
BY
'\r\n'
FROM
t2
;
eval
load
data
infile
'$MYSQLTEST_VARDIR/tmp/t2'
into
table
t1
FIELDS
TERMINATED
BY
''
OPTIONALLY
ENCLOSED
BY
''
LINES
TERMINATED
BY
'\r\n'
;
enable_query_log
;
select
f1
from
t1
where
f2
<>
'0000-00-00 00:00:00'
;
--
exec
rm
$MYSQLTEST_VARDIR
/
tmp
/
t2
drop
table
t1
,
t2
;
# End of 5.0 tests
# End of 5.0 tests
...
...
sql/sql_load.cc
View file @
e4af9fc7
...
@@ -605,6 +605,8 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
...
@@ -605,6 +605,8 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_TOO_FEW_RECORDS
,
ER_WARN_TOO_FEW_RECORDS
,
ER
(
ER_WARN_TOO_FEW_RECORDS
),
thd
->
row_count
);
ER
(
ER_WARN_TOO_FEW_RECORDS
),
thd
->
row_count
);
if
(
!
field
->
maybe_null
()
&&
field
->
type
()
==
FIELD_TYPE_TIMESTAMP
)
((
Field_timestamp
*
)
field
)
->
set_time
();
}
}
else
else
{
{
...
@@ -782,6 +784,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
...
@@ -782,6 +784,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
thd
->
row_count
);
thd
->
row_count
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
if
(
!
field
->
maybe_null
()
&&
field
->
type
()
==
FIELD_TYPE_TIMESTAMP
)
((
Field_timestamp
*
)
field
)
->
set_time
();
/*
/*
QQ: We probably should not throw warning for each field.
QQ: We probably should not throw warning for each field.
But how about intention to always have the same number
But how about intention to always have the same number
...
...
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