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
1d056f5a
Commit
1d056f5a
authored
Oct 03, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: not a VTMD table warning [related to #199]
parent
9062385c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
16 deletions
+81
-16
mysql-test/suite/versioning/r/vtmd.result
mysql-test/suite/versioning/r/vtmd.result
+16
-4
mysql-test/suite/versioning/t/vtmd.test
mysql-test/suite/versioning/t/vtmd.test
+10
-4
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+5
-2
sql/sql_base.cc
sql/sql_base.cc
+25
-4
sql/table.h
sql/table.h
+6
-0
sql/vtmd.cc
sql/vtmd.cc
+19
-2
No files found.
mysql-test/suite/versioning/r/vtmd.result
View file @
1d056f5a
...
...
@@ -281,7 +281,7 @@ A_start B_end name C_archive_name
1 0 t3 t3_
1 0 t3 t3_
1 1 t3 NULL
set versioning_hide
= auto;
set versioning_hide= auto;
call show_tables();
Tables_in_test
t2
...
...
@@ -293,7 +293,7 @@ t2 test
t2_vtmd test
t3 test
t3_vtmd test
set versioning_hide
= implicit;
set versioning_hide= implicit;
call show_tables();
Tables_in_test
t2
...
...
@@ -305,7 +305,7 @@ t2 test
t2_vtmd test
t3 test
t3_vtmd test
set versioning_hide
= full;
set versioning_hide= full;
call show_tables();
Tables_in_test
t2
...
...
@@ -317,7 +317,7 @@ t2 test
t2_vtmd test
t3 test
t3_vtmd test
set versioning_hide
= never;
set versioning_hide= never;
call show_tables();
Tables_in_test
t0_TIMESTAMP_SUFFIX
...
...
@@ -342,6 +342,18 @@ t3 test
t3_TIMESTAMP_SUFFIX test
t3_TIMESTAMP_SUFFIX test
t3_vtmd test
set versioning_hide= auto;
create or replace table u0_vtmd (x int) with system versioning;
show tables;
Tables_in_test
t2
t2_vtmd
t3
t3_vtmd
u0_vtmd
u0_vtmd_vtmd
Warnings:
Warning 4088 Table `test.u0_vtmd` is not a VTMD table
drop database db0;
drop database db1;
drop database test;
...
...
mysql-test/suite/versioning/t/vtmd.test
View file @
1d056f5a
...
...
@@ -174,19 +174,25 @@ alter table t3 change x x bigint;
alter
table
t3
change
x
x
bigint
after
sys_trx_start
;
call
check_vtmd
(
't3_vtmd'
);
set
versioning_hide
=
auto
;
# hide archive tables
set
versioning_hide
=
auto
;
call
show_tables
();
set
versioning_hide
=
implicit
;
set
versioning_hide
=
implicit
;
call
show_tables
();
set
versioning_hide
=
full
;
set
versioning_hide
=
full
;
call
show_tables
();
set
versioning_hide
=
never
;
set
versioning_hide
=
never
;
--
replace_regex
/
\d
{
8
}
_\d
{
6
}
_\d
{
6
}
/
TIMESTAMP_SUFFIX
/
call
show_tables
();
# wrong VTMD handling
set
versioning_hide
=
auto
;
create
or
replace
table
u0_vtmd
(
x
int
)
with
system
versioning
;
show
tables
;
drop
database
db0
;
drop
database
db1
;
drop
database
test
;
...
...
sql/share/errmsg-utf8.txt
View file @
1d056f5a
...
...
@@ -7588,3 +7588,6 @@ ER_VERS_ALTER_SYSTEM_FIELD
ER_VERS_SYS_FIELD_NOT_HIDDEN
eng "System versioning field '%s' is not hidden"
ER_NOT_LOG_TABLE
eng "Table `%s.%s` is not a log table"
sql/sql_base.cc
View file @
1d056f5a
...
...
@@ -8723,11 +8723,32 @@ open_log_table(THD *thd, TABLE_LIST *one_table, Open_tables_backup *backup)
if
((
table
=
open_ltable
(
thd
,
one_table
,
one_table
->
lock_type
,
flags
)))
{
DBUG_ASSERT
(
table
->
s
->
table_category
==
TABLE_CATEGORY_LOG
);
if
(
table
->
s
->
table_category
==
TABLE_CATEGORY_LOG
)
{
/* Make sure all columns get assigned to a default value */
table
->
use_all_columns
();
DBUG_ASSERT
(
table
->
no_replicate
);
}
else
{
my_error
(
ER_NOT_LOG_TABLE
,
MYF
(
0
),
table
->
s
->
db
.
str
,
table
->
s
->
table_name
.
str
);
int
error
=
0
;
if
(
table
->
current_lock
!=
F_UNLCK
)
{
table
->
current_lock
=
F_UNLCK
;
error
=
table
->
file
->
ha_external_lock
(
thd
,
F_UNLCK
);
}
if
(
error
)
table
->
file
->
print_error
(
error
,
MYF
(
0
));
else
{
tc_release_table
(
table
);
thd
->
reset_open_tables_state
(
thd
);
thd
->
restore_backup_open_tables_state
(
backup
);
table
=
NULL
;
}
}
}
else
thd
->
restore_backup_open_tables_state
(
backup
);
...
...
sql/table.h
View file @
1d056f5a
...
...
@@ -1530,6 +1530,12 @@ struct TABLE
return
s
->
versioned
&&
file
->
native_versioned
();
}
bool
vers_vtmd
()
const
{
DBUG_ASSERT
(
s
);
return
s
->
versioned
&&
s
->
vtmd
;
}
Field
*
vers_start_field
()
const
{
DBUG_ASSERT
(
s
&&
s
->
versioned
);
...
...
sql/vtmd.cc
View file @
1d056f5a
...
...
@@ -593,6 +593,7 @@ VTMD_table::get_archive_tables(THD *thd, const char *db, size_t db_length,
if
(
get_vtmd_tables
(
thd
,
db
,
db_length
,
vtmd_tables
))
return
true
;
Local_da
local_da
(
thd
,
ER_VERS_VTMD_ERROR
);
for
(
uint
i
=
0
;
i
<
vtmd_tables
.
elements
();
i
++
)
{
LEX_STRING
table_name
=
*
vtmd_tables
.
at
(
i
);
...
...
@@ -603,8 +604,24 @@ VTMD_table::get_archive_tables(THD *thd, const char *db, size_t db_length,
table_name
.
str
,
TL_READ
);
TABLE
*
table
=
open_log_table
(
thd
,
&
table_list
,
&
open_tables_backup
);
if
(
!
table
)
if
(
!
table
||
!
table
->
vers_vtmd
())
{
if
(
table
)
close_log_table
(
thd
,
&
open_tables_backup
);
else
{
if
(
local_da
.
is_error
()
&&
local_da
.
sql_errno
()
==
ER_NOT_LOG_TABLE
)
local_da
.
reset_diagnostics_area
();
else
return
true
;
}
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
ER_VERS_VTMD_ERROR
,
"Table `%s.%s` is not a VTMD table"
,
db
,
table_name
.
str
);
continue
;
}
READ_RECORD
read_record
;
int
error
=
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