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
56ba5be1
Commit
56ba5be1
authored
Jan 13, 2020
by
Nikita Malyavin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ASAN: nullable fields require more space
parent
42f87b0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
mysql-test/suite/period/r/overlaps.result
mysql-test/suite/period/r/overlaps.result
+1
-1
sql/sql_table.cc
sql/sql_table.cc
+22
-7
No files found.
mysql-test/suite/period/r/overlaps.result
View file @
56ba5be1
...
...
@@ -104,7 +104,7 @@ show create table t;
Table Create Table
t CREATE TABLE `t` (
`id` int(11) NOT NULL,
`u` int(11)
DEFAUL
T NULL,
`u` int(11)
NO
T NULL,
`s` date NOT NULL,
`e` date NOT NULL,
PERIOD FOR `p` (`s`, `e`),
...
...
sql/sql_table.cc
View file @
56ba5be1
...
...
@@ -3959,6 +3959,28 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
DBUG_RETURN
(
TRUE
);
}
switch
(
key
->
type
)
{
case
Key
:
:
UNIQUE
:
if
(
!
key
->
period
)
break
;
/* Fall through:
WITHOUT OVERLAPS forces fields to be NOT NULL
*/
case
Key
:
:
PRIMARY
:
/* Implicitly set primary key fields to NOT NULL for ISO conf. */
if
(
!
(
sql_field
->
flags
&
NOT_NULL_FLAG
))
{
/* Implicitly set primary key fields to NOT NULL for ISO conf. */
sql_field
->
flags
|=
NOT_NULL_FLAG
;
sql_field
->
pack_flag
&=
~
FIELDFLAG_MAYBE_NULL
;
null_fields
--
;
}
break
;
default:
// Fall through
break
;
}
cols2
.
rewind
();
switch
(
key
->
type
)
{
...
...
@@ -3996,13 +4018,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
*
sql_field
,
file
))
DBUG_RETURN
(
TRUE
);
if
(
!
(
sql_field
->
flags
&
NOT_NULL_FLAG
))
{
/* Implicitly set primary key fields to NOT NULL for ISO conf. */
sql_field
->
flags
|=
NOT_NULL_FLAG
;
sql_field
->
pack_flag
&=
~
FIELDFLAG_MAYBE_NULL
;
null_fields
--
;
}
break
;
case
Key
:
:
MULTIPLE
:
...
...
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