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
6ce20fb2
Commit
6ce20fb2
authored
Jun 28, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9428 NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined
fix the *other* fill_record() too, arrgh!
parent
9c38308d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
mysql-test/r/trigger_null-8605.result
mysql-test/r/trigger_null-8605.result
+2
-3
mysql-test/t/trigger_null-8605.test
mysql-test/t/trigger_null-8605.test
+2
-1
sql/sql_base.cc
sql/sql_base.cc
+2
-1
No files found.
mysql-test/r/trigger_null-8605.result
View file @
6ce20fb2
...
...
@@ -318,9 +318,8 @@ id
delete from t1;
create trigger t1_bi before insert on t1 for each row begin end;
insert t1 values (0);
select * from t1;
id
0
insert t1 (id) values (0);
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
drop table t1;
create table t1 (a int not null, b int);
create trigger trgi before update on t1 for each row do 1;
...
...
mysql-test/t/trigger_null-8605.test
View file @
6ce20fb2
...
...
@@ -336,7 +336,8 @@ select * from t1;
delete
from
t1
;
create
trigger
t1_bi
before
insert
on
t1
for
each
row
begin
end
;
insert
t1
values
(
0
);
select
*
from
t1
;
--
error
ER_DUP_ENTRY
insert
t1
(
id
)
values
(
0
);
drop
table
t1
;
#
...
...
sql/sql_base.cc
View file @
6ce20fb2
...
...
@@ -8728,7 +8728,8 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
value
=
v
++
;
Field
*
rfield
=
field
->
field
;
TABLE
*
table
=
rfield
->
table
;
if
(
rfield
==
table
->
next_number_field
)
if
(
table
->
next_number_field
&&
rfield
->
field_index
==
table
->
next_number_field
->
field_index
)
table
->
auto_increment_field_not_null
=
TRUE
;
if
(
rfield
->
vcol_info
&&
value
->
type
()
!=
Item
::
DEFAULT_VALUE_ITEM
&&
...
...
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