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
9b79888d
Commit
9b79888d
authored
May 22, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12866 Out-of-range error with CREATE..SELECT..TO_SECONDS(NOW())
parent
c84bbeda
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
5 deletions
+26
-5
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+12
-0
mysql-test/r/metadata.result
mysql-test/r/metadata.result
+1
-1
mysql-test/r/partition_column.result
mysql-test/r/partition_column.result
+1
-1
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+9
-0
sql/item_timefunc.h
sql/item_timefunc.h
+3
-3
No files found.
mysql-test/r/func_time.result
View file @
9b79888d
...
...
@@ -3282,3 +3282,15 @@ DROP TABLE t2;
DROP VIEW v1;
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
# MDEV-12866 Out-of-range error with CREATE..SELECT..TO_SECONDS(NOW())
#
SET sql_mode=STRICT_ALL_TABLES;
CREATE TABLE t1 AS SELECT TO_SECONDS('9999-12-31 23:59:59');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`TO_SECONDS('9999-12-31 23:59:59')` bigint(12) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET sql_mode=DEFAULT;
mysql-test/r/metadata.result
View file @
9b79888d
...
...
@@ -476,7 +476,7 @@ def PERIOD_DIFF(200802,200703) 3 6 2 N 32897 0 63
def TO_DAYS('2007-10-07') 3 6 6 Y 32896 0 63
def DAYOFMONTH('2007-02-03') 3 2 1 Y 32896 0 63
def DAYOFWEEK('2007-02-03') 3 1 1 Y 32896 0 63
def TO_SECONDS('2013-06-13')
3 6
11 Y 32896 0 63
def TO_SECONDS('2013-06-13')
8 12
11 Y 32896 0 63
PERIOD_ADD(200801,2) PERIOD_DIFF(200802,200703) TO_DAYS('2007-10-07') DAYOFMONTH('2007-02-03') DAYOFWEEK('2007-02-03') TO_SECONDS('2013-06-13')
200803 11 733321 3 7 63538300800
SELECT
...
...
mysql-test/r/partition_column.result
View file @
9b79888d
...
...
@@ -542,7 +542,7 @@ create table t1 as select to_seconds(null) as to_seconds;
select data_type from information_schema.columns
where table_schema='test' and column_name='to_seconds';
data_type
int
big
int
drop table t1;
create table t1 (a int, b int)
partition by list columns(a,b)
...
...
mysql-test/t/func_time.test
View file @
9b79888d
...
...
@@ -1871,3 +1871,12 @@ DROP TABLE t2;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
SET
sql_mode
=
DEFAULT
;
--
echo
#
--
echo
# MDEV-12866 Out-of-range error with CREATE..SELECT..TO_SECONDS(NOW())
--
echo
#
SET
sql_mode
=
STRICT_ALL_TABLES
;
CREATE
TABLE
t1
AS
SELECT
TO_SECONDS
(
'9999-12-31 23:59:59'
);
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
SET
sql_mode
=
DEFAULT
;
sql/item_timefunc.h
View file @
9b79888d
...
...
@@ -89,16 +89,16 @@ class Item_func_to_days :public Item_long_func
};
class
Item_func_to_seconds
:
public
Item_long_func
class
Item_func_to_seconds
:
public
Item_long
long
_func
{
public:
Item_func_to_seconds
(
THD
*
thd
,
Item
*
a
)
:
Item_long_func
(
thd
,
a
)
{}
Item_func_to_seconds
(
THD
*
thd
,
Item
*
a
)
:
Item_long
long
_func
(
thd
,
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"to_seconds"
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
6
*
MY_CHARSET_BIN_MB_MAXLEN
;
fix_char_length
(
12
)
;
maybe_null
=
1
;
}
enum_monotonicity_info
get_monotonicity_info
()
const
;
...
...
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