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
5f1d2aae
Commit
5f1d2aae
authored
Jul 03, 2009
by
Bernt M. Johnsen
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
f8a36093
5572f8e7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
4 deletions
+42
-4
mysql-test/r/partition.result
mysql-test/r/partition.result
+9
-0
mysql-test/suite/rpl/t/rpl_sp.test
mysql-test/suite/rpl/t/rpl_sp.test
+3
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+11
-0
sql/item.cc
sql/item.cc
+8
-2
sql/sql_partition.cc
sql/sql_partition.cc
+11
-2
No files found.
mysql-test/r/partition.result
View file @
5f1d2aae
...
...
@@ -1982,5 +1982,14 @@ SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range bc bc 10 NULL 7 Using where; Using index for group-by
DROP TABLE t1;
#
# Bug #45807: crash accessing partitioned table and sql_mode
# contains ONLY_FULL_GROUP_BY
#
SET SESSION SQL_MODE='ONLY_FULL_GROUP_BY';
CREATE TABLE t1(id INT,KEY(id)) ENGINE=MYISAM
PARTITION BY HASH(id) PARTITIONS 2;
DROP TABLE t1;
SET SESSION SQL_MODE=DEFAULT;
End of 5.1 tests
SET @@global.general_log= @old_general_log;
mysql-test/suite/rpl/t/rpl_sp.test
View file @
5f1d2aae
...
...
@@ -642,3 +642,6 @@ drop procedure ` mysqltestbug36570_p2`;
drop
function
mysqltestbug36570_f1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.1
tests
# Cleanup
sync_slave_with_master
;
mysql-test/t/partition.test
View file @
5f1d2aae
...
...
@@ -1976,6 +1976,17 @@ SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #45807: crash accessing partitioned table and sql_mode
--
echo
# contains ONLY_FULL_GROUP_BY
--
echo
#
SET
SESSION
SQL_MODE
=
'ONLY_FULL_GROUP_BY'
;
CREATE
TABLE
t1
(
id
INT
,
KEY
(
id
))
ENGINE
=
MYISAM
PARTITION
BY
HASH
(
id
)
PARTITIONS
2
;
DROP
TABLE
t1
;
SET
SESSION
SQL_MODE
=
DEFAULT
;
--
echo
End
of
5.1
tests
SET
@@
global
.
general_log
=
@
old_general_log
;
sql/item.cc
View file @
5f1d2aae
...
...
@@ -4406,16 +4406,22 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
Fields from outer selects added to the aggregate function
outer_fields list as its unknown at the moment whether it's
aggregated or not.
We're using either the select lex of the cached table (if present)
or the field's resolution context. context->select_lex is
safe for use because it's either the SELECT we want to use
(the current level) or a stub added by non-SELECT queries.
*/
SELECT_LEX
*
select_lex
=
cached_table
?
cached_table
->
select_lex
:
context
->
select_lex
;
if
(
!
thd
->
lex
->
in_sum_func
)
cached_table
->
select_lex
->
full_group_by_flag
|=
NON_AGG_FIELD_USED
;
select_lex
->
full_group_by_flag
|=
NON_AGG_FIELD_USED
;
else
{
if
(
outer_fixed
)
thd
->
lex
->
in_sum_func
->
outer_fields
.
push_back
(
this
);
else
if
(
thd
->
lex
->
in_sum_func
->
nest_level
!=
thd
->
lex
->
current_select
->
nest_level
)
cached_table
->
select_lex
->
full_group_by_flag
|=
NON_AGG_FIELD_USED
;
select_lex
->
full_group_by_flag
|=
NON_AGG_FIELD_USED
;
}
}
return
FALSE
;
...
...
sql/sql_partition.cc
View file @
5f1d2aae
...
...
@@ -918,6 +918,9 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
Set-up the TABLE_LIST object to be a list with a single table
Set the object to zero to create NULL pointers and set alias
and real name to table name and get database name from file name.
TODO: Consider generalizing or refactoring Lex::add_table_to_list() so
it can be used in all places where we create TABLE_LIST objects.
Also consider creating appropriate constructors for TABLE_LIST.
*/
bzero
((
void
*
)
&
tables
,
sizeof
(
TABLE_LIST
));
...
...
@@ -925,6 +928,13 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
tables
.
table
=
table
;
tables
.
next_local
=
0
;
tables
.
next_name_resolution_table
=
0
;
/*
Cache the table in Item_fields. All the tables can be cached except
the trigger pseudo table.
*/
tables
.
cacheable_table
=
TRUE
;
context
=
thd
->
lex
->
current_context
();
tables
.
select_lex
=
context
->
select_lex
;
strmov
(
db_name_string
,
table
->
s
->
normalized_path
.
str
);
dir_length
=
dirname_length
(
db_name_string
);
db_name_string
[
dir_length
-
1
]
=
0
;
...
...
@@ -932,7 +942,6 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
db_name
=
&
db_name_string
[
home_dir_length
];
tables
.
db
=
db_name
;
context
=
thd
->
lex
->
current_context
();
table
->
map
=
1
;
//To ensure correct calculation of const item
table
->
get_fields_in_item_tree
=
TRUE
;
save_table_list
=
context
->
table_list
;
...
...
@@ -965,7 +974,7 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
save_use_only_table_context
=
thd
->
lex
->
use_only_table_context
;
thd
->
lex
->
use_only_table_context
=
TRUE
;
error
=
func_expr
->
fix_fields
(
thd
,
(
Item
**
)
0
);
error
=
func_expr
->
fix_fields
(
thd
,
(
Item
**
)
&
func_expr
);
thd
->
lex
->
use_only_table_context
=
save_use_only_table_context
;
...
...
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