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
e86fc82c
Commit
e86fc82c
authored
Oct 06, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #1434 (and related issues)
parent
08a08a67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
mysql-test/t/create.test
mysql-test/t/create.test
+21
-1
sql/sql_class.h
sql/sql_class.h
+2
-2
sql/sql_insert.cc
sql/sql_insert.cc
+12
-2
No files found.
mysql-test/t/create.test
View file @
e86fc82c
...
...
@@ -129,8 +129,28 @@ insert into t1 values ("a", 1), ("b", 2);
drop
table
t1
;
#
# Bug #
801
# Bug #801
#
create
table
t1
select
x
'4132'
;
drop
table
t1
;
#
# bug #1434
#
create
table
t1
select
1
,
2
,
3
;
create
table
if
not
exists
t1
select
1
,
2
;
--
error
1136
create
table
if
not
exists
t1
select
1
,
2
,
3
,
4
;
create
table
if
not
exists
t1
select
1
;
select
*
from
t1
;
drop
table
t1
;
create
table
t1
select
1
,
2
,
3
;
create
table
if
not
exists
t1
select
1
,
2
;
--
error
1136
create
table
if
not
exists
t1
select
1
,
2
,
3
,
4
;
create
table
if
not
exists
t1
select
1
;
select
*
from
t1
;
drop
table
t1
;
sql/sql_class.h
View file @
e86fc82c
...
...
@@ -703,6 +703,7 @@ class select_create: public select_insert {
HA_CREATE_INFO
*
create_info
;
MYSQL_LOCK
*
lock
;
Field
**
field
;
my_bool
do_not_drop
;
public:
select_create
(
const
char
*
db_name
,
const
char
*
table_name
,
HA_CREATE_INFO
*
create_info_par
,
...
...
@@ -711,8 +712,7 @@ public:
List
<
Item
>
&
select_fields
,
enum_duplicates
duplic
)
:
select_insert
(
NULL
,
&
select_fields
,
duplic
),
db
(
db_name
),
name
(
table_name
),
extra_fields
(
&
fields_par
),
keys
(
&
keys_par
),
create_info
(
create_info_par
),
lock
(
0
)
create_info
(
create_info_par
),
lock
(
0
),
do_not_drop
(
0
)
{}
int
prepare
(
List
<
Item
>
&
list
);
bool
send_data
(
List
<
Item
>
&
values
);
...
...
sql/sql_insert.cc
View file @
e86fc82c
...
...
@@ -1438,6 +1438,15 @@ select_create::prepare(List<Item> &values)
if
(
!
table
)
DBUG_RETURN
(
-
1
);
// abort() deletes table
if
(
table
->
fields
<
values
.
elements
)
{
do_not_drop
=
1
;
my_printf_error
(
ER_WRONG_VALUE_COUNT_ON_ROW
,
ER
(
ER_WRONG_VALUE_COUNT_ON_ROW
),
MYF
(
0
),
1
);
DBUG_RETURN
(
-
1
);
}
/* First field to copy */
field
=
table
->
field
+
table
->
fields
-
values
.
elements
;
...
...
@@ -1498,7 +1507,7 @@ bool select_create::send_eof()
*/
if
(
!
table
->
tmp_table
)
hash_delete
(
&
open_cache
,(
byte
*
)
table
);
lock
=
0
;
lock
=
0
;
table
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
}
...
...
@@ -1519,7 +1528,8 @@ void select_create::abort()
enum
db_type
table_type
=
table
->
db_type
;
if
(
!
table
->
tmp_table
)
hash_delete
(
&
open_cache
,(
byte
*
)
table
);
quick_rm_table
(
table_type
,
db
,
name
);
if
(
!
do_not_drop
)
quick_rm_table
(
table_type
,
db
,
name
);
table
=
0
;
}
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
...
...
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