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
239790d9
Commit
239790d9
authored
Feb 09, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11604 Assertion `!check_datetime_range(ltime)' failed in TIME_to_longlong_datetime_packed
parent
1afb1107
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
1 deletion
+77
-1
mysql-test/suite/vcol/r/vcol_keys_innodb.result
mysql-test/suite/vcol/r/vcol_keys_innodb.result
+33
-0
mysql-test/suite/vcol/t/vcol_keys_innodb.test
mysql-test/suite/vcol/t/vcol_keys_innodb.test
+40
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-1
No files found.
mysql-test/suite/vcol/r/vcol_keys_innodb.result
View file @
239790d9
...
...
@@ -225,3 +225,36 @@ ALTER TABLE t1 ADD COLUMN col INT;
SELECT * FROM t1 WHERE vi < 2;
i vi col
DROP TABLE t1, t2;
create table t1 (
pk int auto_increment,
col_varchar varchar(847) not null default '',
col_int bigint(15) unsigned zerofill,
col_datetime datetime(3) not null default '1900-01-01 00:00:00',
col_time time(5) not null default '00:00:00',
col_blob text,
col_bit bit(34),
col_year year,
col_char char(10),
col_dec decimal(18,9) not null default 0,
col_enum enum('','a','b','c','d','e','f','foo','bar') not null default '',
col_date date not null default '1900-01-01',
col_timestamp timestamp(3) not null default '1971-01-01 00:00:00',
vcol_datetime datetime as (col_datetime) virtual,
vcol_dec decimal(18,9) zerofill as (col_dec) virtual,
vcol_bit bit(63) as (col_bit) virtual,
vcol_char binary(51) as (col_char) virtual,
vcol_timestamp timestamp(5) as (col_timestamp) virtual,
vcol_enum enum('','a','b','c','d','e','f','foo','bar') as (col_enum) virtual,
vcol_int tinyint(48) zerofill as (col_int) virtual,
vcol_time time(4) as (col_time) virtual,
vcol_varchar varbinary(3873) as (col_varchar) virtual,
vcol_year year as (col_year) virtual,
vcol_date date as (col_date) virtual,
vcol_blob longtext as (col_blob) virtual,
primary key(pk)
) engine=innodb;
insert into t1 (col_varchar,col_int,col_datetime,col_time,col_blob,col_bit,col_year,col_char,col_dec,col_enum,col_date,col_timestamp) values
('foo',1,'2010-05-08 13:08:12.034783','18:32:14','foo',b'0111110101001001',1992,'f',0.2,'','1994-12-26','2019-01-11 00:00:00'),
('bar',6,'1900-01-01 00:00:00','00:00:00','bar',b'10011000001101011000101',1985,'b',0.7,'','2028-04-06','1971-01-01 00:00:00');
alter table t1 add index(vcol_datetime);
drop table t1;
mysql-test/suite/vcol/t/vcol_keys_innodb.test
View file @
239790d9
...
...
@@ -61,3 +61,43 @@ CREATE TABLE t2 (i INT) ENGINE=InnoDB;
ALTER
TABLE
t1
ADD
COLUMN
col
INT
;
SELECT
*
FROM
t1
WHERE
vi
<
2
;
DROP
TABLE
t1
,
t2
;
#
# MDEV-11604 Assertion `!check_datetime_range(ltime)' failed in TIME_to_longlong_datetime_packed
#
create
table
t1
(
pk
int
auto_increment
,
col_varchar
varchar
(
847
)
not
null
default
''
,
col_int
bigint
(
15
)
unsigned
zerofill
,
col_datetime
datetime
(
3
)
not
null
default
'1900-01-01 00:00:00'
,
col_time
time
(
5
)
not
null
default
'00:00:00'
,
col_blob
text
,
col_bit
bit
(
34
),
col_year
year
,
col_char
char
(
10
),
col_dec
decimal
(
18
,
9
)
not
null
default
0
,
col_enum
enum
(
''
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
'foo'
,
'bar'
)
not
null
default
''
,
col_date
date
not
null
default
'1900-01-01'
,
col_timestamp
timestamp
(
3
)
not
null
default
'1971-01-01 00:00:00'
,
vcol_datetime
datetime
as
(
col_datetime
)
virtual
,
vcol_dec
decimal
(
18
,
9
)
zerofill
as
(
col_dec
)
virtual
,
vcol_bit
bit
(
63
)
as
(
col_bit
)
virtual
,
vcol_char
binary
(
51
)
as
(
col_char
)
virtual
,
vcol_timestamp
timestamp
(
5
)
as
(
col_timestamp
)
virtual
,
vcol_enum
enum
(
''
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
'foo'
,
'bar'
)
as
(
col_enum
)
virtual
,
vcol_int
tinyint
(
48
)
zerofill
as
(
col_int
)
virtual
,
vcol_time
time
(
4
)
as
(
col_time
)
virtual
,
vcol_varchar
varbinary
(
3873
)
as
(
col_varchar
)
virtual
,
vcol_year
year
as
(
col_year
)
virtual
,
vcol_date
date
as
(
col_date
)
virtual
,
vcol_blob
longtext
as
(
col_blob
)
virtual
,
primary
key
(
pk
)
)
engine
=
innodb
;
insert
into
t1
(
col_varchar
,
col_int
,
col_datetime
,
col_time
,
col_blob
,
col_bit
,
col_year
,
col_char
,
col_dec
,
col_enum
,
col_date
,
col_timestamp
)
values
(
'foo'
,
1
,
'2010-05-08 13:08:12.034783'
,
'18:32:14'
,
'foo'
,
b
'0111110101001001'
,
1992
,
'f'
,
0.2
,
''
,
'1994-12-26'
,
'2019-01-11 00:00:00'
),
(
'bar'
,
6
,
'1900-01-01 00:00:00'
,
'00:00:00'
,
'bar'
,
b
'10011000001101011000101'
,
1985
,
'b'
,
0.7
,
''
,
'2028-04-06'
,
'1971-01-01 00:00:00'
);
alter
table
t1
add
index
(
vcol_datetime
);
drop
table
t1
;
sql/sql_yacc.yy
View file @
239790d9
...
...
@@ -6197,7 +6197,10 @@ opt_serial_attribute_list:
field_def:
opt_attribute
| opt_generated_always AS virtual_column_func
{ Lex->last_field->vcol_info= $3; }
{
Lex->last_field->vcol_info= $3;
Lex->last_field->flags&= ~NOT_NULL_FLAG; // undo automatic NOT NULL for timestamps
}
vcol_opt_specifier vcol_opt_attribute
;
...
...
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