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
f4823792
Commit
f4823792
authored
Mar 05, 2007
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/mnt/gentoo64/work/clean-5.0-opt-mysql
parents
6274ee84
629c1231
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
5 deletions
+22
-5
mysql-test/r/update.result
mysql-test/r/update.result
+4
-0
mysql-test/t/update.test
mysql-test/t/update.test
+8
-0
sql/sql_base.cc
sql/sql_base.cc
+9
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-5
No files found.
mysql-test/r/update.result
View file @
f4823792
...
...
@@ -377,6 +377,10 @@ create table t1(f1 int, `*f2` int);
insert into t1 values (1,1);
update t1 set `*f2`=1;
drop table t1;
create table t1(f1 int);
update t1 set f2=1 order by f2;
ERROR 42S22: Unknown column 'f2' in 'order clause'
drop table t1;
CREATE TABLE t1 (
request_id int unsigned NOT NULL auto_increment,
user_id varchar(12) default NULL,
...
...
mysql-test/t/update.test
View file @
f4823792
...
...
@@ -306,6 +306,14 @@ create table t1(f1 int, `*f2` int);
insert
into
t1
values
(
1
,
1
);
update
t1
set
`*f2`
=
1
;
drop
table
t1
;
#
# Bug#25126: Wrongly resolved field leads to a crash
#
create
table
t1
(
f1
int
);
--
error
1054
update
t1
set
f2
=
1
order
by
f2
;
drop
table
t1
;
# End of 4.1 tests
#
...
...
sql/sql_base.cc
View file @
f4823792
...
...
@@ -4420,12 +4420,15 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
bool
save_set_query_id
=
thd
->
set_query_id
;
nesting_map
save_allow_sum_func
=
thd
->
lex
->
allow_sum_func
;
List_iterator
<
Item
>
it
(
fields
);
bool
save_is_item_list_lookup
;
DBUG_ENTER
(
"setup_fields"
);
thd
->
set_query_id
=
set_query_id
;
if
(
allow_sum_func
)
thd
->
lex
->
allow_sum_func
|=
1
<<
thd
->
lex
->
current_select
->
nest_level
;
thd
->
where
=
THD
::
DEFAULT_WHERE
;
save_is_item_list_lookup
=
thd
->
lex
->
current_select
->
is_item_list_lookup
;
thd
->
lex
->
current_select
->
is_item_list_lookup
=
0
;
/*
To prevent fail on forward lookup we fill it with zerows,
...
...
@@ -4448,6 +4451,7 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
if
(
!
item
->
fixed
&&
item
->
fix_fields
(
thd
,
it
.
ref
())
||
(
item
=
*
(
it
.
ref
()))
->
check_cols
(
1
))
{
thd
->
lex
->
current_select
->
is_item_list_lookup
=
save_is_item_list_lookup
;
thd
->
lex
->
allow_sum_func
=
save_allow_sum_func
;
thd
->
set_query_id
=
save_set_query_id
;
DBUG_RETURN
(
TRUE
);
/* purecov: inspected */
...
...
@@ -4460,6 +4464,7 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
thd
->
used_tables
|=
item
->
used_tables
();
thd
->
lex
->
current_select
->
cur_pos_in_select_list
++
;
}
thd
->
lex
->
current_select
->
is_item_list_lookup
=
save_is_item_list_lookup
;
thd
->
lex
->
current_select
->
cur_pos_in_select_list
=
UNDEF_POS
;
thd
->
lex
->
allow_sum_func
=
save_allow_sum_func
;
...
...
@@ -4956,6 +4961,8 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
*/
bool
it_is_update
=
(
select_lex
==
&
thd
->
lex
->
select_lex
)
&&
thd
->
lex
->
which_check_option_applicable
();
bool
save_is_item_list_lookup
=
select_lex
->
is_item_list_lookup
;
select_lex
->
is_item_list_lookup
=
0
;
DBUG_ENTER
(
"setup_conds"
);
if
(
select_lex
->
conds_processed_with_permanent_arena
||
...
...
@@ -5030,9 +5037,11 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
select_lex
->
where
=
*
conds
;
select_lex
->
conds_processed_with_permanent_arena
=
1
;
}
thd
->
lex
->
current_select
->
is_item_list_lookup
=
save_is_item_list_lookup
;
DBUG_RETURN
(
test
(
thd
->
net
.
report_error
));
err_no_arena:
select_lex
->
is_item_list_lookup
=
save_is_item_list_lookup
;
DBUG_RETURN
(
1
);
}
...
...
sql/sql_select.cc
View file @
f4823792
...
...
@@ -396,6 +396,7 @@ JOIN::prepare(Item ***rref_pointer_array,
join_list
=
&
select_lex
->
top_join_list
;
union_part
=
(
unit_arg
->
first_select
()
->
next_select
()
!=
0
);
thd
->
lex
->
current_select
->
is_item_list_lookup
=
1
;
/*
If we have already executed SELECT, then it have not sense to prevent
its table from update (see unique_table())
...
...
@@ -13265,16 +13266,11 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
We check order_item->fixed because Item_func_group_concat can put
arguments for which fix_fields already was called.
*/
thd
->
lex
->
current_select
->
is_item_list_lookup
=
1
;
if
(
!
order_item
->
fixed
&&
(
order_item
->
fix_fields
(
thd
,
order
->
item
)
||
(
order_item
=
*
order
->
item
)
->
check_cols
(
1
)
||
thd
->
is_fatal_error
))
{
thd
->
lex
->
current_select
->
is_item_list_lookup
=
0
;
return
TRUE
;
/* Wrong field. */
}
thd
->
lex
->
current_select
->
is_item_list_lookup
=
0
;
uint
el
=
all_fields
.
elements
;
all_fields
.
push_front
(
order_item
);
/* Add new field to field list. */
...
...
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