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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
6112e67d
Commit
6112e67d
authored
Mar 22, 2003
by
jani@hynda.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added error in case auto_increment and default where defined
at the same time.
parent
17537ba7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
sql/sql_parse.cc
sql/sql_parse.cc
+14
-6
No files found.
sql/sql_parse.cc
View file @
6112e67d
...
@@ -2880,21 +2880,29 @@ bool add_field_to_list(char *field_name, enum_field_types type,
...
@@ -2880,21 +2880,29 @@ bool add_field_to_list(char *field_name, enum_field_types type,
lex
->
col_list
.
empty
();
lex
->
col_list
.
empty
();
}
}
if
(
default_value
&&
default_value
->
type
()
==
Item
::
NULL_ITEM
)
if
(
default_value
)
{
if
(
default_value
->
type
()
==
Item
::
NULL_ITEM
)
{
{
default_value
=
0
;
if
((
type_modifier
&
(
NOT_NULL_FLAG
|
AUTO_INCREMENT_FLAG
))
==
if
((
type_modifier
&
(
NOT_NULL_FLAG
|
AUTO_INCREMENT_FLAG
))
==
NOT_NULL_FLAG
)
NOT_NULL_FLAG
)
{
{
net_printf
(
&
thd
->
net
,
ER_INVALID_DEFAULT
,
field_name
);
net_printf
(
&
thd
->
net
,
ER_INVALID_DEFAULT
,
field_name
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
default_value
=
0
;
}
else
if
(
type_modifier
&
AUTO_INCREMENT_FLAG
)
{
net_printf
(
&
thd
->
net
,
ER_INVALID_DEFAULT
,
field_name
);
DBUG_RETURN
(
1
);
}
}
}
if
(
!
(
new_field
=
new
create_field
()))
if
(
!
(
new_field
=
new
create_field
()))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
new_field
->
field
=
0
;
new_field
->
field
=
0
;
new_field
->
field_name
=
field_name
;
new_field
->
field_name
=
field_name
;
new_field
->
def
=
(
type_modifier
&
AUTO_INCREMENT_FLAG
?
0
:
default_value
)
;
new_field
->
def
=
default_value
;
new_field
->
flags
=
type_modifier
;
new_field
->
flags
=
type_modifier
;
new_field
->
unireg_check
=
(
type_modifier
&
AUTO_INCREMENT_FLAG
?
new_field
->
unireg_check
=
(
type_modifier
&
AUTO_INCREMENT_FLAG
?
Field
::
NEXT_NUMBER
:
Field
::
NONE
);
Field
::
NEXT_NUMBER
:
Field
::
NONE
);
...
...
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