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
b58098c3
Commit
b58098c3
authored
Oct 06, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #1434 (and related issues)
parent
2667d7f8
Changes
3
Show 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 @
b58098c3
...
@@ -129,8 +129,28 @@ insert into t1 values ("a", 1), ("b", 2);
...
@@ -129,8 +129,28 @@ insert into t1 values ("a", 1), ("b", 2);
drop
table
t1
;
drop
table
t1
;
#
#
# Bug #
801
# Bug #801
#
#
create
table
t1
select
x
'4132'
;
create
table
t1
select
x
'4132'
;
drop
table
t1
;
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 @
b58098c3
...
@@ -703,6 +703,7 @@ class select_create: public select_insert {
...
@@ -703,6 +703,7 @@ class select_create: public select_insert {
HA_CREATE_INFO
*
create_info
;
HA_CREATE_INFO
*
create_info
;
MYSQL_LOCK
*
lock
;
MYSQL_LOCK
*
lock
;
Field
**
field
;
Field
**
field
;
my_bool
do_not_drop
;
public:
public:
select_create
(
const
char
*
db_name
,
const
char
*
table_name
,
select_create
(
const
char
*
db_name
,
const
char
*
table_name
,
HA_CREATE_INFO
*
create_info_par
,
HA_CREATE_INFO
*
create_info_par
,
...
@@ -711,8 +712,7 @@ public:
...
@@ -711,8 +712,7 @@ public:
List
<
Item
>
&
select_fields
,
enum_duplicates
duplic
)
List
<
Item
>
&
select_fields
,
enum_duplicates
duplic
)
:
select_insert
(
NULL
,
&
select_fields
,
duplic
),
db
(
db_name
),
:
select_insert
(
NULL
,
&
select_fields
,
duplic
),
db
(
db_name
),
name
(
table_name
),
extra_fields
(
&
fields_par
),
keys
(
&
keys_par
),
name
(
table_name
),
extra_fields
(
&
fields_par
),
keys
(
&
keys_par
),
create_info
(
create_info_par
),
create_info
(
create_info_par
),
lock
(
0
),
do_not_drop
(
0
)
lock
(
0
)
{}
{}
int
prepare
(
List
<
Item
>
&
list
);
int
prepare
(
List
<
Item
>
&
list
);
bool
send_data
(
List
<
Item
>
&
values
);
bool
send_data
(
List
<
Item
>
&
values
);
...
...
sql/sql_insert.cc
View file @
b58098c3
...
@@ -1438,6 +1438,15 @@ select_create::prepare(List<Item> &values)
...
@@ -1438,6 +1438,15 @@ select_create::prepare(List<Item> &values)
if
(
!
table
)
if
(
!
table
)
DBUG_RETURN
(
-
1
);
// abort() deletes 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 */
/* First field to copy */
field
=
table
->
field
+
table
->
fields
-
values
.
elements
;
field
=
table
->
field
+
table
->
fields
-
values
.
elements
;
...
@@ -1519,6 +1528,7 @@ void select_create::abort()
...
@@ -1519,6 +1528,7 @@ void select_create::abort()
enum
db_type
table_type
=
table
->
db_type
;
enum
db_type
table_type
=
table
->
db_type
;
if
(
!
table
->
tmp_table
)
if
(
!
table
->
tmp_table
)
hash_delete
(
&
open_cache
,(
byte
*
)
table
);
hash_delete
(
&
open_cache
,(
byte
*
)
table
);
if
(
!
do_not_drop
)
quick_rm_table
(
table_type
,
db
,
name
);
quick_rm_table
(
table_type
,
db
,
name
);
table
=
0
;
table
=
0
;
}
}
...
...
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