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
1b4bb3b5
Commit
1b4bb3b5
authored
Apr 02, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19124 Assertion `0' failed in Item::val_native
parent
88400450
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
0 deletions
+57
-0
mysql-test/main/type_timestamp.result
mysql-test/main/type_timestamp.result
+24
-0
mysql-test/main/type_timestamp.test
mysql-test/main/type_timestamp.test
+15
-0
sql/item_windowfunc.cc
sql/item_windowfunc.cc
+8
-0
sql/item_windowfunc.h
sql/item_windowfunc.h
+10
-0
No files found.
mysql-test/main/type_timestamp.result
View file @
1b4bb3b5
...
...
@@ -1194,5 +1194,29 @@ CREATE TABLE t2 SELECT 1 AS f FROM t1 GROUP BY FROM_DAYS(d);
ERROR 22007: Truncated incorrect date value: '0000-00-00'
DROP TABLE t1;
#
# MDEV-19124 Assertion `0' failed in Item::val_native
#
CREATE TABLE t1 (d1 TIMESTAMP(5));
INSERT INTO t1 VALUES ('2018-10-14 15:31:01');
SELECT LEAD(d1,1) OVER(ORDER BY d1) FROM t1;
LEAD(d1,1) OVER(ORDER BY d1)
NULL
SELECT LAG(d1,1) OVER(ORDER BY d1) FROM t1;
LAG(d1,1) OVER(ORDER BY d1)
NULL
INSERT INTO t1 VALUES ('2018-10-14 15:31:02');
INSERT INTO t1 VALUES ('2018-10-14 15:31:03');
SELECT LEAD(d1,1) OVER(ORDER BY d1) FROM t1;
LEAD(d1,1) OVER(ORDER BY d1)
2018-10-14 15:31:02.00000
2018-10-14 15:31:03.00000
NULL
SELECT LAG(d1,1) OVER(ORDER BY d1) FROM t1;
LAG(d1,1) OVER(ORDER BY d1)
NULL
2018-10-14 15:31:01.00000
2018-10-14 15:31:02.00000
DROP TABLE t1;
#
# End of 10.4 tests
#
mysql-test/main/type_timestamp.test
View file @
1b4bb3b5
...
...
@@ -786,6 +786,21 @@ CREATE TABLE t2 SELECT 1 AS f FROM t1 GROUP BY FROM_DAYS(d);
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-19124 Assertion `0' failed in Item::val_native
--
echo
#
CREATE
TABLE
t1
(
d1
TIMESTAMP
(
5
));
INSERT
INTO
t1
VALUES
(
'2018-10-14 15:31:01'
);
SELECT
LEAD
(
d1
,
1
)
OVER
(
ORDER
BY
d1
)
FROM
t1
;
SELECT
LAG
(
d1
,
1
)
OVER
(
ORDER
BY
d1
)
FROM
t1
;
INSERT
INTO
t1
VALUES
(
'2018-10-14 15:31:02'
);
INSERT
INTO
t1
VALUES
(
'2018-10-14 15:31:03'
);
SELECT
LEAD
(
d1
,
1
)
OVER
(
ORDER
BY
d1
)
FROM
t1
;
SELECT
LAG
(
d1
,
1
)
OVER
(
ORDER
BY
d1
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.4 tests
--
echo
#
sql/item_windowfunc.cc
View file @
1b4bb3b5
...
...
@@ -439,6 +439,14 @@ Item_sum_hybrid_simple::val_str(String *str)
return
retval
;
}
bool
Item_sum_hybrid_simple
::
val_native
(
THD
*
thd
,
Native
*
to
)
{
DBUG_ASSERT
(
fixed
==
1
);
if
(
null_value
)
return
true
;
return
val_native_from_item
(
thd
,
value
,
to
);
}
bool
Item_sum_hybrid_simple
::
get_date
(
THD
*
thd
,
MYSQL_TIME
*
ltime
,
date_mode_t
fuzzydate
)
{
DBUG_ASSERT
(
fixed
==
1
);
...
...
sql/item_windowfunc.h
View file @
1b4bb3b5
...
...
@@ -318,6 +318,7 @@ class Item_sum_hybrid_simple : public Item_sum,
my_decimal
*
val_decimal
(
my_decimal
*
);
void
reset_field
();
String
*
val_str
(
String
*
);
bool
val_native
(
THD
*
thd
,
Native
*
to
);
bool
get_date
(
THD
*
thd
,
MYSQL_TIME
*
ltime
,
date_mode_t
fuzzydate
);
const
Type_handler
*
type_handler
()
const
{
return
Type_handler_hybrid_field_type
::
type_handler
();
}
...
...
@@ -1250,6 +1251,15 @@ class Item_window_func : public Item_func_or_sum
return
res
;
}
bool
val_native
(
THD
*
thd
,
Native
*
to
)
{
if
(
force_return_blank
)
return
null_value
=
true
;
if
(
read_value_from_result_field
)
return
val_native_from_field
(
result_field
,
to
);
return
val_native_from_item
(
thd
,
window_func
(),
to
);
}
my_decimal
*
val_decimal
(
my_decimal
*
dec
)
{
my_decimal
*
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