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
912769b7
Commit
912769b7
authored
Jan 06, 2018
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: lower priority of warning in vers_part_rotate() for ALTER [fixes #446]
parent
daf883f9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
3 deletions
+33
-3
mysql-test/suite/versioning/r/partition.result
mysql-test/suite/versioning/r/partition.result
+9
-0
mysql-test/suite/versioning/t/partition.test
mysql-test/suite/versioning/t/partition.test
+8
-0
sql/partition_info.cc
sql/partition_info.cc
+5
-3
sql/sql_table.cc
sql/sql_table.cc
+1
-0
sql/table.h
sql/table.h
+10
-0
No files found.
mysql-test/suite/versioning/r/partition.result
View file @
912769b7
...
...
@@ -251,6 +251,15 @@ x
3
4
5
### Assertion in ALTER on warning from partitioning LIMIT [#446]
create or replace table t1 (x int) with system versioning;
insert into t1 values (1), (2);
delete from t1;
alter table t1 partition by system_time limit 1 (
partition p1 history,
partition pn current);
Warnings:
Note 4113 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
## rotation by INTERVAL
create or replace table t1 (x int)
with system versioning
...
...
mysql-test/suite/versioning/t/partition.test
View file @
912769b7
...
...
@@ -216,6 +216,14 @@ insert into t1 values (4), (5);
delete
from
t1
;
select
*
from
t1
partition
(
p1
)
order
by
x
;
--
echo
### Assertion in ALTER on warning from partitioning LIMIT [#446]
create
or
replace
table
t1
(
x
int
)
with
system
versioning
;
insert
into
t1
values
(
1
),
(
2
);
delete
from
t1
;
alter
table
t1
partition
by
system_time
limit
1
(
partition
p1
history
,
partition
pn
current
);
--
echo
## rotation by INTERVAL
--
error
ER_PART_WRONG_VALUE
create
or
replace
table
t1
(
x
int
)
...
...
sql/partition_info.cc
View file @
912769b7
...
...
@@ -897,10 +897,12 @@ partition_info::vers_part_rotate(THD * thd)
{
DBUG_ASSERT
(
table
->
s
->
hist_part_id
==
vers_info
->
now_part
->
id
-
1
);
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
thd
->
lex
->
sql_command
==
SQLCOM_ALTER_TABLE
?
Sql_condition
::
WARN_LEVEL_NOTE
:
Sql_condition
::
WARN_LEVEL_WARN
,
WARN_VERS_PART_FULL
,
ER_THD
(
thd
,
WARN_VERS_PART_FULL
),
table
->
s
->
db
.
str
,
table
->
s
->
table_name
.
str
,
table
->
s
->
db
.
str
,
table
->
s
->
error_table_name
()
,
vers_info
->
hist_part
->
partition_name
);
return
vers_info
->
hist_part
;
}
...
...
@@ -913,7 +915,7 @@ partition_info::vers_part_rotate(THD * thd)
Sql_condition
::
WARN_LEVEL_NOTE
,
WARN_VERS_PART_ROTATION
,
ER_THD
(
thd
,
WARN_VERS_PART_ROTATION
),
table
->
s
->
db
.
str
,
table
->
s
->
table_name
.
str
,
table
->
s
->
db
.
str
,
table
->
s
->
error_table_name
()
,
old_part_name
,
vers_info
->
hist_part
->
partition_name
);
...
...
sql/sql_table.cc
View file @
912769b7
...
...
@@ -9780,6 +9780,7 @@ bool mysql_alter_table(THD *thd, const char *new_db, const char *new_name,
}
if
(
!
new_table
)
goto
err_new_table_cleanup
;
new_table
->
s
->
orig_table_name
=
table
->
s
->
table_name
.
str
;
new_versioned
=
new_table
->
versioned
();
/*
Note: In case of MERGE table, we do not attach children. We do not
...
...
sql/table.h
View file @
912769b7
...
...
@@ -648,6 +648,16 @@ struct TABLE_SHARE
LEX_CSTRING
normalized_path
;
/* unpack_filename(path) */
LEX_CSTRING
connect_string
;
const
char
*
orig_table_name
;
/* Original table name for this tmp table */
const
char
*
error_table_name
()
const
/* Get table name for error messages */
{
return
tmp_table
?
(
orig_table_name
?
orig_table_name
:
"(temporary)"
)
:
table_name
.
str
;
}
/*
Set of keys in use, implemented as a Bitmap.
Excludes keys disabled by ALTER TABLE ... DISABLE KEYS.
...
...
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