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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
6e81ba0c
Commit
6e81ba0c
authored
Jul 03, 2020
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't give errors for default value copy in create_tmp_table
parent
53ecc354
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
mysql-test/main/type_temporal_innodb.result
mysql-test/main/type_temporal_innodb.result
+15
-0
mysql-test/main/type_temporal_innodb.test
mysql-test/main/type_temporal_innodb.test
+19
-0
sql/sql_select.cc
sql/sql_select.cc
+7
-0
No files found.
mysql-test/main/type_temporal_innodb.result
View file @
6e81ba0c
...
...
@@ -160,3 +160,18 @@ SELECT * FROM t1 WHERE LEAST( UTC_TIME(), d );
d
2012-12-21
DROP TABLE t1;
#
# MDEV-17969 Assertion `name' failed in THD::push_warning_truncated_value_for_field
#
CREATE TABLE t1 (c1 DATE , c2 TIMESTAMP) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('2006-07-17','0000-00-00 00:00:00');
CREATE TABLE t2 (pk INT, a1 TIME) Engine=InnoDB;
INSERT INTO t2 VALUES (6,'00:00:00');
SET SESSION sql_mode= 'strict_all_tables,no_zero_date';
CREATE TABLE tbl SELECT * FROM t1 WHERE t1.c1 = (SELECT c2 FROM t2 WHERE pk = 6);
ERROR 22007: Truncated incorrect datetime value: '0000-00-00 00:00:00'
DROP TABLE t1,t2;
SET sql_mode=DEFAULT;
#
# End of 10.3 tests
#
mysql-test/main/type_temporal_innodb.test
View file @
6e81ba0c
...
...
@@ -66,3 +66,22 @@ CREATE TABLE t1 (d DATE) ENGINE=InnoDB;
INSERT
INTO
t1
VALUES
(
'2012-12-21'
);
SELECT
*
FROM
t1
WHERE
LEAST
(
UTC_TIME
(),
d
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-17969 Assertion `name' failed in THD::push_warning_truncated_value_for_field
--
echo
#
CREATE
TABLE
t1
(
c1
DATE
,
c2
TIMESTAMP
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
'2006-07-17'
,
'0000-00-00 00:00:00'
);
CREATE
TABLE
t2
(
pk
INT
,
a1
TIME
)
Engine
=
InnoDB
;
INSERT
INTO
t2
VALUES
(
6
,
'00:00:00'
);
SET
SESSION
sql_mode
=
'strict_all_tables,no_zero_date'
;
--
error
ER_TRUNCATED_WRONG_VALUE
CREATE
TABLE
tbl
SELECT
*
FROM
t1
WHERE
t1
.
c1
=
(
SELECT
c2
FROM
t2
WHERE
pk
=
6
);
# ^^^ there is no column c2 in table t2
DROP
TABLE
t1
,
t2
;
SET
sql_mode
=
DEFAULT
;
--
echo
#
--
echo
# End of 10.3 tests
--
echo
#
sql/sql_select.cc
View file @
6e81ba0c
...
...
@@ -17460,6 +17460,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
bool
using_unique_constraint
=
false
;
bool
use_packed_rows
=
false
;
bool
not_all_columns
=
!
(
select_options
&
TMP_TABLE_ALL_COLUMNS
);
bool
save_abort_on_warning
;
char
*
tmpname
,
path
[
FN_REFLEN
];
uchar
*
pos
,
*
group_buff
,
*
bitmaps
;
uchar
*
null_flags
;
...
...
@@ -17932,6 +17933,11 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
}
null_count
=
(
blob_count
==
0
)
?
1
:
0
;
hidden_field_count
=
param
->
hidden_field_count
;
/* Protect against warnings in field_conv() in the next loop*/
save_abort_on_warning
=
thd
->
abort_on_warning
;
thd
->
abort_on_warning
=
0
;
for
(
i
=
0
,
reg_field
=
table
->
field
;
i
<
field_count
;
i
++
,
reg_field
++
,
recinfo
++
)
{
Field
*
field
=
*
reg_field
;
...
...
@@ -18018,6 +18024,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
bzero
(
pos
,
table
->
s
->
reclength
-
(
pos
-
table
->
record
[
0
]));
MEM_CHECK_DEFINED
(
table
->
record
[
0
],
table
->
s
->
reclength
);
thd
->
abort_on_warning
=
save_abort_on_warning
;
param
->
copy_field_end
=
copy
;
param
->
recinfo
=
recinfo
;
// Pointer to after last field
store_record
(
table
,
s
->
default_values
);
// Make empty default record
...
...
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