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
8ad23ff4
Commit
8ad23ff4
authored
Feb 16, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't allow TIME columns in PERIOD specification
parent
7b48724d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
mysql-test/suite/period/r/create.result
mysql-test/suite/period/r/create.result
+3
-0
mysql-test/suite/period/t/create.test
mysql-test/suite/period/t/create.test
+3
-0
sql/handler.cc
sql/handler.cc
+2
-1
No files found.
mysql-test/suite/period/r/create.result
View file @
8ad23ff4
...
...
@@ -40,6 +40,9 @@ ERROR HY000: Fields of PERIOD FOR `mytime` have different types
create or replace table t (id int primary key, s int, e date,
period for mytime(s,e));
ERROR 42000: Incorrect column specifier for column 's'
create or replace table t (id int primary key, s time, e time,
period for mytime(s,e));
ERROR 42000: Incorrect column specifier for column 's'
create or replace table t (id int primary key, s date, e date,
period for mytime(s,x));
ERROR 42S22: Unknown column 'x' in 'mytime'
...
...
mysql-test/suite/period/t/create.test
View file @
8ad23ff4
...
...
@@ -26,6 +26,9 @@ create or replace table t (s timestamp(2), e timestamp(6),
--
error
ER_WRONG_FIELD_SPEC
create
or
replace
table
t
(
id
int
primary
key
,
s
int
,
e
date
,
period
for
mytime
(
s
,
e
));
--
error
ER_WRONG_FIELD_SPEC
create
or
replace
table
t
(
id
int
primary
key
,
s
time
,
e
time
,
period
for
mytime
(
s
,
e
));
--
error
ER_BAD_FIELD_ERROR
create
or
replace
table
t
(
id
int
primary
key
,
s
date
,
e
date
,
period
for
mytime
(
s
,
x
));
...
...
sql/handler.cc
View file @
8ad23ff4
...
...
@@ -7593,7 +7593,8 @@ bool Table_period_info::check_field(const Create_field* f,
my_error
(
ER_BAD_FIELD_ERROR
,
MYF
(
0
),
f_name
.
str
,
name
.
str
);
res
=
true
;
}
else
if
(
f
->
type_handler
()
->
mysql_timestamp_type
()
==
MYSQL_TIMESTAMP_ERROR
)
else
if
(
f
->
type_handler
()
->
mysql_timestamp_type
()
!=
MYSQL_TIMESTAMP_DATE
&&
f
->
type_handler
()
->
mysql_timestamp_type
()
!=
MYSQL_TIMESTAMP_DATETIME
)
{
my_error
(
ER_WRONG_FIELD_SPEC
,
MYF
(
0
),
f
->
field_name
.
str
);
res
=
true
;
...
...
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