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
f987de71
Commit
f987de71
authored
Aug 16, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/5.5' into 10.1
parents
ecdacf72
ec1f195e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
2 deletions
+70
-2
mysql-test/r/type_int.result
mysql-test/r/type_int.result
+24
-0
mysql-test/t/type_int.test
mysql-test/t/type_int.test
+21
-0
sql/sql_select.cc
sql/sql_select.cc
+25
-2
No files found.
mysql-test/r/type_int.result
View file @
f987de71
#
#
# Start of 5.5 tests
#
#
# MDEV-15955 Assertion `field_types == 0 || field_types[field_pos] == MYSQL_TYPE_LONGLONG' failed in Protocol_text::store_longlong
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
SELECT @a := 1 FROM t1 ORDER BY STRCMP(STDDEV_SAMP(a), 'bar');
@a := 1
1
SELECT COALESCE(1) FROM t1 ORDER BY STRCMP(STDDEV_SAMP(a), 'bar');
COALESCE(1)
1
SELECT COALESCE(@a:=1) FROM t1 ORDER BY STRCMP(STDDEV_SAMP(a), 'bar');
COALESCE(@a:=1)
1
SELECT COALESCE(@a) FROM t1 ORDER BY STRCMP(STDDEV_SAMP(a), 'bar');
COALESCE(@a)
1
DROP TABLE t1;
#
# End of 5.5 tests
#
#
# Start of 10.1 tests
# Start of 10.1 tests
#
#
#
#
...
...
mysql-test/t/type_int.test
View file @
f987de71
--
echo
#
--
echo
# Start of 5.5 tests
--
echo
#
--
echo
#
--
echo
# MDEV-15955 Assertion `field_types == 0 || field_types[field_pos] == MYSQL_TYPE_LONGLONG' failed in Protocol_text::store_longlong
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
SELECT
@
a
:=
1
FROM
t1
ORDER
BY
STRCMP
(
STDDEV_SAMP
(
a
),
'bar'
);
SELECT
COALESCE
(
1
)
FROM
t1
ORDER
BY
STRCMP
(
STDDEV_SAMP
(
a
),
'bar'
);
SELECT
COALESCE
(
@
a
:=
1
)
FROM
t1
ORDER
BY
STRCMP
(
STDDEV_SAMP
(
a
),
'bar'
);
SELECT
COALESCE
(
@
a
)
FROM
t1
ORDER
BY
STRCMP
(
STDDEV_SAMP
(
a
),
'bar'
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
--
echo
#
--
echo
#
--
echo
# Start of 10.1 tests
--
echo
# Start of 10.1 tests
--
echo
#
--
echo
#
...
...
sql/sql_select.cc
View file @
f987de71
...
@@ -16158,8 +16158,31 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
...
@@ -16158,8 +16158,31 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
{
{
Field *UNINIT_VAR(new_field);
Field *UNINIT_VAR(new_field);
DBUG_ASSERT(thd == table->in_use);
DBUG_ASSERT(thd == table->in_use);
new_field
=
item
->
Item
::
create_tmp_field
(
false
,
table
);
if (item->type() == Item::FUNC_ITEM &&
static_cast<Item_func*>(item)->functype() == Item_func::SUSERVAR_FUNC)
{
/*
A temporary solution for versions 5.5 .. 10.3.
This change should be null-merged to 10.4.
Item_func_set_user_var is special. It overrides make_field().
by adding a special branch `if (result_field)...`.
So it's important to preserve the exact data type here,
to avoid type mismatch in Protocol_text::store_longlong()
See MDEV-15955.
Other Item_func descendants are not affected by MDEV-15955.
They don't override make_field() so they don't use result_field
when initializing Send_field.
This is properly fixed in 10.4 in the method
Item_func_user_var::create_tmp_field_ex().
*/
new_field= item->tmp_table_field_from_field_type(table, false, true);
}
else
new_field= item->Item::create_tmp_field(false, table);
if (copy_func &&
if (copy_func &&
(item->is_result_field() ||
(item->is_result_field() ||
(item->real_item()->is_result_field())))
(item->real_item()->is_result_field())))
...
...
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