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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
dc654646
Commit
dc654646
authored
Jun 23, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
insert_update.result, insert_update.test, sql_base.cc:
Fix for bugfix #9728 merge
parent
5c8e3341
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
mysql-test/r/insert_update.result
mysql-test/r/insert_update.result
+1
-1
mysql-test/t/insert_update.test
mysql-test/t/insert_update.test
+1
-1
sql/sql_base.cc
sql/sql_base.cc
+9
-4
No files found.
mysql-test/r/insert_update.result
View file @
dc654646
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1
, t2
;
CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B));
INSERT t1 VALUES (1,2,10), (3,4,20);
INSERT t1 VALUES (5,6,30) ON DUPLICATE KEY UPDATE c=c+100;
...
...
mysql-test/t/insert_update.test
View file @
dc654646
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
c
INT
,
UNIQUE
(
A
),
UNIQUE
(
B
));
...
...
sql/sql_base.cc
View file @
dc654646
...
...
@@ -2626,7 +2626,6 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
uint
length
=
(
uint
)
strlen
(
name
);
char
name_buff
[
NAME_LEN
+
1
];
if
(
item
->
cached_table
)
{
/*
...
...
@@ -2693,10 +2692,13 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
db
=
name_buff
;
}
bool
search_global
=
item
->
item_flags
&
MY_ITEM_PREFER_1ST_TABLE
;
if
(
table_name
&&
table_name
[
0
])
{
/* Qualified field */
bool
found_table
=
0
;
for
(;
tables
;
tables
=
tables
->
next_local
)
bool
found_table
=
0
;
uint
table_idx
=
0
;
for
(;
tables
;
tables
=
search_global
?
tables
->
next_global
:
tables
->
next_local
,
table_idx
++
)
{
/* TODO; Ensure that db and tables->db always points to something ! */
if
(
!
my_strcasecmp
(
table_alias_charset
,
tables
->
alias
,
table_name
)
&&
...
...
@@ -2732,6 +2734,8 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
return
(
Field
*
)
0
;
}
found
=
find
;
if
(
table_idx
==
0
&&
item
->
item_flags
&
MY_ITEM_PREFER_1ST_TABLE
)
break
;
}
}
}
...
...
@@ -2758,7 +2762,8 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
}
bool
allow_rowid
=
tables
&&
!
tables
->
next_local
;
// Only one table
uint
table_idx
=
0
;
for
(;
tables
;
tables
=
tables
->
next_local
,
table_idx
++
)
for
(;
tables
;
tables
=
search_global
?
tables
->
next_global
:
tables
->
next_local
,
table_idx
++
)
{
if
(
!
tables
->
table
&&
!
tables
->
ancestor
)
{
...
...
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