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
59004f01
Commit
59004f01
authored
Dec 16, 2003
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed restoring of thd->count_cuted_fields in store_val_in_field
(fixed #bug 2012)
parent
2e04da08
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
1 deletion
+50
-1
mysql-test/r/insert_select.result
mysql-test/r/insert_select.result
+12
-0
mysql-test/t/insert_select.test
mysql-test/t/insert_select.test
+31
-0
sql/sql_select.cc
sql/sql_select.cc
+7
-1
No files found.
mysql-test/r/insert_select.result
View file @
59004f01
...
@@ -11,3 +11,15 @@ payoutID
...
@@ -11,3 +11,15 @@ payoutID
19
19
20
20
22
22
Month Type Field Count
2003-09-01 1 1 100
2003-09-01 1 2 100
2003-09-01 2 1 100
2003-09-01 2 2 100
2003-09-01 3 1 100
NULL Field Count
NULL 1 100
NULL 2 100
No Field Count
0 1 100
0 2 100
mysql-test/t/insert_select.test
View file @
59004f01
...
@@ -10,3 +10,34 @@ insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
...
@@ -10,3 +10,34 @@ insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
insert
into
t2
(
payoutID
)
SELECT
payoutID
+
10
FROM
t1
;
insert
into
t2
(
payoutID
)
SELECT
payoutID
+
10
FROM
t1
;
select
*
from
t2
;
select
*
from
t2
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Another problem from Bug #2012
#
CREATE
TABLE
t1
(
Month
date
NOT
NULL
,
Type
tinyint
(
3
)
unsigned
NOT
NULL
auto_increment
,
Field
int
(
10
)
unsigned
NOT
NULL
,
Count
int
(
10
)
unsigned
NOT
NULL
,
UNIQUE
KEY
Month
(
Month
,
Type
,
Field
)
);
insert
into
t1
Values
(
20030901
,
1
,
1
,
100
),
(
20030901
,
1
,
2
,
100
),
(
20030901
,
2
,
1
,
100
),
(
20030901
,
2
,
2
,
100
),
(
20030901
,
3
,
1
,
100
);
select
*
from
t1
;
Select
null
,
Field
,
Count
From
t1
Where
Month
=
20030901
and
Type
=
2
;
create
table
t2
(
No
int
not
null
,
Field
int
not
null
,
Count
int
not
null
);
insert
into
t2
Select
null
,
Field
,
Count
From
t1
Where
Month
=
20030901
and
Type
=
2
;
select
*
from
t2
;
drop
table
t1
,
t2
;
sql/sql_select.cc
View file @
59004f01
...
@@ -2184,9 +2184,15 @@ store_val_in_field(Field *field,Item *item)
...
@@ -2184,9 +2184,15 @@ store_val_in_field(Field *field,Item *item)
{
{
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
ulong
cuted_fields
=
thd
->
cuted_fields
;
ulong
cuted_fields
=
thd
->
cuted_fields
;
/*
we should restore old value of count_cuted_fields because
store_val_in_field can be called from mysql_insert
with select_insert, which make count_cuted_fields= 1
*/
bool
old_count_cuted_fields
=
thd
->
count_cuted_fields
;
thd
->
count_cuted_fields
=
1
;
thd
->
count_cuted_fields
=
1
;
item
->
save_in_field
(
field
);
item
->
save_in_field
(
field
);
thd
->
count_cuted_fields
=
0
;
thd
->
count_cuted_fields
=
old_count_cuted_fields
;
return
cuted_fields
!=
thd
->
cuted_fields
;
return
cuted_fields
!=
thd
->
cuted_fields
;
}
}
...
...
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