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
24897407
Commit
24897407
authored
Mar 24, 2006
by
pappa@c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#16806: ALTER TABLE with new field in before position fails
Review fixes
parent
4362a7a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
+27
-13
sql/sql_partition.cc
sql/sql_partition.cc
+18
-2
sql/sql_table.cc
sql/sql_table.cc
+9
-11
No files found.
sql/sql_partition.cc
View file @
24897407
...
...
@@ -1741,8 +1741,7 @@ bool fix_partition_func(THD *thd, const char* name, TABLE *table,
tables
.
db
=
db_name
;
if
(
!
is_create_table_ind
||
(
is_create_table_ind
&&
thd
->
lex
->
sql_command
!=
SQLCOM_CREATE_TABLE
))
thd
->
lex
->
sql_command
!=
SQLCOM_CREATE_TABLE
)
{
if
(
partition_default_handling
(
table
,
part_info
,
is_create_table_ind
,
...
...
@@ -3770,7 +3769,24 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
}
}
else
{
/*
When we come here we are doing a create table. In this case we
have already done some preparatory work on the old part_info
object. We don't really need this new partition_info object.
Thus we go back to the old partition info object.
We need to free any memory objects allocated on item_free_list
by the parser since we are keeping the old info from the first
parser call in CREATE TABLE.
We'll ensure that this object isn't put into table cache also
just to ensure we don't get into strange situations with the
item objects.
*/
free_items
(
thd
->
free_list
);
part_info
=
thd
->
work_part_info
;
thd
->
free_list
=
NULL
;
table
->
s
->
version
=
0UL
;
}
}
table
->
part_info
=
part_info
;
table
->
file
->
set_part_info
(
part_info
);
...
...
sql/sql_table.cc
View file @
24897407
...
...
@@ -2154,24 +2154,22 @@ bool mysql_create_table_internal(THD *thd,
*/
if
(
part_info
->
use_default_no_partitions
&&
part_info
->
no_parts
&&
part_info
->
no_parts
!=
file
->
get_default_no_partitions
(
0ULL
))
(
int
)
part_info
->
no_parts
!=
file
->
get_default_no_partitions
(
0ULL
))
{
uint
i
=
0
;
bool
first
=
TRUE
;
uint
i
;
List_iterator
<
partition_element
>
part_it
(
part_info
->
partitions
);
do
{
partition_element
*
part_elem
=
part_it
++
;
if
(
!
first
)
part_elem
->
part_state
=
PART_TO_BE_DROPPED
;
first
=
FALSE
;
}
while
(
++
i
<
part_info
->
partitions
.
elements
);
part_it
++
;
DBUG_ASSERT
(
thd
->
lex
->
sql_command
!=
SQLCOM_CREATE_TABLE
);
for
(
i
=
1
;
i
<
part_info
->
partitions
.
elements
;
i
++
)
(
part_it
++
)
->
part_state
=
PART_TO_BE_DROPPED
;
}
else
if
(
part_info
->
is_sub_partitioned
()
&&
part_info
->
use_default_no_subpartitions
&&
part_info
->
no_subparts
&&
part_info
->
no_subparts
!=
file
->
get_default_no_partitions
(
0ULL
))
(
int
)
part_info
->
no_subparts
!=
file
->
get_default_no_partitions
(
0ULL
))
{
DBUG_ASSERT
(
thd
->
lex
->
sql_command
!=
SQLCOM_CREATE_TABLE
);
part_info
->
no_subparts
=
file
->
get_default_no_partitions
(
0ULL
);
}
}
...
...
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