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
4a980567
Commit
4a980567
authored
Sep 15, 2004
by
mskold@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed handling of NO_AUTO_VALUE_ON_ZERO
parent
089e0565
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
mysql-test/r/ndb_alter_table.result
mysql-test/r/ndb_alter_table.result
+1
-0
mysql-test/t/ndb_alter_table.test
mysql-test/t/ndb_alter_table.test
+1
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+6
-2
No files found.
mysql-test/r/ndb_alter_table.result
View file @
4a980567
...
...
@@ -19,6 +19,7 @@ col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 ndbcluster 9 Dynamic 0 0 0 NULL 0 0 1 NULL NULL NULL latin1_swedish_ci NULL
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
insert into t1 values
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
show table status;
...
...
mysql-test/t/ndb_alter_table.test
View file @
4a980567
...
...
@@ -31,6 +31,7 @@ col4 varchar(4) not null,
col5
enum
(
'PENDING'
,
'ACTIVE'
,
'DISABLED'
)
not
null
,
col6
int
not
null
,
to_be_deleted
int
)
ENGINE
=
ndbcluster
;
show
table
status
;
SET
SQL_MODE
=
NO_AUTO_VALUE_ON_ZERO
;
insert
into
t1
values
(
0
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),(
NULL
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),(
31
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
7
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
NULL
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
100
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
99
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
8
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
NULL
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
);
show
table
status
;
...
...
sql/ha_ndbcluster.cc
View file @
4a980567
...
...
@@ -1526,7 +1526,11 @@ int ha_ndbcluster::write_row(byte *record)
if
(
table
->
timestamp_default_now
)
update_timestamp
(
record
+
table
->
timestamp_default_now
-
1
);
has_auto_increment
=
(
table
->
next_number_field
&&
record
==
table
->
record
[
0
]);
skip_auto_increment
=
table
->
auto_increment_field_not_null
;
skip_auto_increment
=
table
->
next_number_field
&&
table
->
next_number_field
->
val_int
()
!=
0
||
table
->
auto_increment_field_not_null
&&
current_thd
->
variables
.
sql_mode
&
MODE_NO_AUTO_VALUE_ON_ZERO
;
if
(
!
(
op
=
trans
->
getNdbOperation
((
const
NDBTAB
*
)
m_table
)))
ERR_RETURN
(
trans
->
getNdbError
());
...
...
@@ -1546,7 +1550,7 @@ int ha_ndbcluster::write_row(byte *record)
{
int
res
;
if
(
(
has_auto_increment
)
&&
(
!
skip_auto_increment
)
)
if
(
has_auto_increment
)
update_auto_increment
();
if
((
res
=
set_primary_key
(
op
)))
...
...
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