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
c82b5892
Commit
c82b5892
authored
May 20, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert of the fix for bug #44399 (joro@sun.com-20090512135917-kal1dvtqpqgnj3yc).
parent
5a716b09
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
29 deletions
+14
-29
mysql-test/r/func_in.result
mysql-test/r/func_in.result
+0
-5
mysql-test/t/func_in.test
mysql-test/t/func_in.test
+0
-10
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+14
-14
No files found.
mysql-test/r/func_in.result
View file @
c82b5892
...
@@ -587,9 +587,4 @@ SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
...
@@ -587,9 +587,4 @@ SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
CASE c1 WHEN c1 + 1 THEN 1 END ABS(AVG(c0))
CASE c1 WHEN c1 + 1 THEN 1 END ABS(AVG(c0))
NULL 1.0000
NULL 1.0000
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(a TEXT);
INSERT INTO t1 VALUES('iynfj');
SELECT SUM( DISTINCT a ) FROM t1 GROUP BY a HAVING a IN ( AVG( 1 ), 1 + a );
SUM( DISTINCT a )
DROP TABLE t1;
End of 5.1 tests
End of 5.1 tests
mysql-test/t/func_in.test
View file @
c82b5892
...
@@ -439,14 +439,4 @@ SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
...
@@ -439,14 +439,4 @@ SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #44399: crash with statement using TEXT columns, aggregates, GROUP BY,
# and HAVING
#
CREATE
TABLE
t1
(
a
TEXT
);
INSERT
INTO
t1
VALUES
(
'iynfj'
);
SELECT
SUM
(
DISTINCT
a
)
FROM
t1
GROUP
BY
a
HAVING
a
IN
(
AVG
(
1
),
1
+
a
);
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/item_cmpfunc.cc
View file @
c82b5892
...
@@ -189,7 +189,6 @@ enum_field_types agg_field_type(Item **items, uint nitems)
...
@@ -189,7 +189,6 @@ enum_field_types agg_field_type(Item **items, uint nitems)
collect_cmp_types()
collect_cmp_types()
items Array of items to collect types from
items Array of items to collect types from
nitems Number of items in the array
nitems Number of items in the array
with_sum_func a sum function is referenced
DESCRIPTION
DESCRIPTION
This function collects different result types for comparison of the first
This function collects different result types for comparison of the first
...
@@ -200,7 +199,7 @@ enum_field_types agg_field_type(Item **items, uint nitems)
...
@@ -200,7 +199,7 @@ enum_field_types agg_field_type(Item **items, uint nitems)
Bitmap of collected types - otherwise
Bitmap of collected types - otherwise
*/
*/
static
uint
collect_cmp_types
(
Item
**
items
,
uint
nitems
,
my_bool
with_sum_func
)
static
uint
collect_cmp_types
(
Item
**
items
,
uint
nitems
)
{
{
uint
i
;
uint
i
;
uint
found_types
;
uint
found_types
;
...
@@ -216,16 +215,6 @@ static uint collect_cmp_types(Item **items, uint nitems, my_bool with_sum_func)
...
@@ -216,16 +215,6 @@ static uint collect_cmp_types(Item **items, uint nitems, my_bool with_sum_func)
found_types
|=
1
<<
(
uint
)
item_cmp_type
(
left_result
,
found_types
|=
1
<<
(
uint
)
item_cmp_type
(
left_result
,
items
[
i
]
->
result_type
());
items
[
i
]
->
result_type
());
}
}
if
(
with_sum_func
||
current_thd
->
lex
->
current_select
->
group_list
.
elements
)
{
/*
See TODO commentary in the setup_copy_fields function:
item in a group may be wrapped with an Item_copy_string item.
That item has a STRING_RESULT result type, so we need
to take this type into account.
*/
found_types
|=
(
1
<<
item_cmp_type
(
left_result
,
STRING_RESULT
));
}
return
found_types
;
return
found_types
;
}
}
...
@@ -2733,8 +2722,19 @@ void Item_func_case::fix_length_and_dec()
...
@@ -2733,8 +2722,19 @@ void Item_func_case::fix_length_and_dec()
for
(
nagg
=
0
;
nagg
<
ncases
/
2
;
nagg
++
)
for
(
nagg
=
0
;
nagg
<
ncases
/
2
;
nagg
++
)
agg
[
nagg
+
1
]
=
args
[
nagg
*
2
];
agg
[
nagg
+
1
]
=
args
[
nagg
*
2
];
nagg
++
;
nagg
++
;
if
(
!
(
found_types
=
collect_cmp_types
(
agg
,
nagg
,
with_sum_func
)))
if
(
!
(
found_types
=
collect_cmp_types
(
agg
,
nagg
)))
return
;
return
;
if
(
with_sum_func
||
current_thd
->
lex
->
current_select
->
group_list
.
elements
)
{
/*
See TODO commentary in the setup_copy_fields function:
item in a group may be wrapped with an Item_copy_string item.
That item has a STRING_RESULT result type, so we need
to take this type into account.
*/
found_types
|=
(
1
<<
item_cmp_type
(
left_result_type
,
STRING_RESULT
));
}
for
(
i
=
0
;
i
<=
(
uint
)
DECIMAL_RESULT
;
i
++
)
for
(
i
=
0
;
i
<=
(
uint
)
DECIMAL_RESULT
;
i
++
)
{
{
if
(
found_types
&
(
1
<<
i
)
&&
!
cmp_items
[
i
])
if
(
found_types
&
(
1
<<
i
)
&&
!
cmp_items
[
i
])
...
@@ -3525,7 +3525,7 @@ void Item_func_in::fix_length_and_dec()
...
@@ -3525,7 +3525,7 @@ void Item_func_in::fix_length_and_dec()
uint
type_cnt
=
0
,
i
;
uint
type_cnt
=
0
,
i
;
Item_result
cmp_type
=
STRING_RESULT
;
Item_result
cmp_type
=
STRING_RESULT
;
left_result_type
=
args
[
0
]
->
result_type
();
left_result_type
=
args
[
0
]
->
result_type
();
if
(
!
(
found_types
=
collect_cmp_types
(
args
,
arg_count
,
with_sum_func
)))
if
(
!
(
found_types
=
collect_cmp_types
(
args
,
arg_count
)))
return
;
return
;
for
(
arg
=
args
+
1
,
arg_end
=
args
+
arg_count
;
arg
!=
arg_end
;
arg
++
)
for
(
arg
=
args
+
1
,
arg_end
=
args
+
arg_count
;
arg
!=
arg_end
;
arg
++
)
...
...
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