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
352f2ada
Commit
352f2ada
authored
Aug 20, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
414e95e8
3b36a677
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletion
+42
-1
mysql-test/suite/innodb/r/innodb_mysql.result
mysql-test/suite/innodb/r/innodb_mysql.result
+12
-0
mysql-test/suite/innodb/t/innodb_mysql.test
mysql-test/suite/innodb/t/innodb_mysql.test
+15
-0
sql/item_func.cc
sql/item_func.cc
+15
-1
No files found.
mysql-test/suite/innodb/r/innodb_mysql.result
View file @
352f2ada
...
...
@@ -2546,6 +2546,18 @@ LOCK TABLES t1 READ;
ALTER TABLE t1 COMMENT 'test';
UNLOCK TABLES;
DROP TABLE t1;
#
# Bug#55826: create table .. select crashes with when KILL_BAD_DATA
# is returned
#
CREATE TABLE t1(a INT) ENGINE=innodb;
INSERT INTO t1 VALUES (0);
SET SQL_MODE='STRICT_ALL_TABLES';
CREATE TABLE t2
SELECT LEAST((SELECT '' FROM t1),NOW()) FROM `t1`;
ERROR 22007: Incorrect datetime value: '' for column 'NOW()' at row 2
DROP TABLE t1;
SET SQL_MODE=DEFAULT;
End of 5.1 tests
#
# Test for bug #39932 "create table fails if column for FK is in different
...
...
mysql-test/suite/innodb/t/innodb_mysql.test
View file @
352f2ada
...
...
@@ -751,6 +751,21 @@ UNLOCK TABLES;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#55826: create table .. select crashes with when KILL_BAD_DATA
--
echo
# is returned
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
innodb
;
INSERT
INTO
t1
VALUES
(
0
);
SET
SQL_MODE
=
'STRICT_ALL_TABLES'
;
--
error
ER_TRUNCATED_WRONG_VALUE
CREATE
TABLE
t2
SELECT
LEAST
((
SELECT
''
FROM
t1
),
NOW
())
FROM
`t1`
;
DROP
TABLE
t1
;
SET
SQL_MODE
=
DEFAULT
;
--
echo
End
of
5.1
tests
...
...
sql/item_func.cc
View file @
352f2ada
...
...
@@ -2551,7 +2551,7 @@ void Item_func_min_max::fix_length_and_dec()
stored to the value pointer, if latter is provided.
RETURN
0 If one of arguments is NULL
0 If one of arguments is NULL
or there was a execution error
# index of the least/greatest argument
*/
...
...
@@ -2565,6 +2565,14 @@ uint Item_func_min_max::cmp_datetimes(ulonglong *value)
Item
**
arg
=
args
+
i
;
bool
is_null
;
longlong
res
=
get_datetime_value
(
thd
,
&
arg
,
0
,
datetime_item
,
&
is_null
);
/* Check if we need to stop (because of error or KILL) and stop the loop */
if
(
thd
->
is_error
())
{
null_value
=
1
;
return
0
;
}
if
((
null_value
=
args
[
i
]
->
null_value
))
return
0
;
if
(
i
==
0
||
(
res
<
min_max
?
cmp_sign
:
-
cmp_sign
)
>
0
)
...
...
@@ -2593,6 +2601,12 @@ String *Item_func_min_max::val_str(String *str)
if
(
null_value
)
return
0
;
str_res
=
args
[
min_max_idx
]
->
val_str
(
str
);
if
(
args
[
min_max_idx
]
->
null_value
)
{
// check if the call to val_str() above returns a NULL value
null_value
=
1
;
return
NULL
;
}
str_res
->
set_charset
(
collation
.
collation
);
return
str_res
;
}
...
...
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