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
6b75a704
Commit
6b75a704
authored
Apr 15, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #9839 Column with AUTOINC contains -1 Value on node stop, post review fix
parent
b112ccb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+18
-5
No files found.
sql/ha_ndbcluster.cc
View file @
6b75a704
...
@@ -48,6 +48,7 @@ static const char *ha_ndb_ext=".ndb";
...
@@ -48,6 +48,7 @@ static const char *ha_ndb_ext=".ndb";
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0
#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0
#define NDB_AUTO_INCREMENT_RETRIES 10
#define ERR_PRINT(err) \
#define ERR_PRINT(err) \
DBUG_PRINT("error", ("%d message: %s", err.code, err.message))
DBUG_PRINT("error", ("%d message: %s", err.code, err.message))
...
@@ -1839,7 +1840,13 @@ int ha_ndbcluster::write_row(byte *record)
...
@@ -1839,7 +1840,13 @@ int ha_ndbcluster::write_row(byte *record)
{
{
// Table has hidden primary key
// Table has hidden primary key
Ndb
*
ndb
=
get_ndb
();
Ndb
*
ndb
=
get_ndb
();
Uint64
auto_value
=
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
);
Uint64
auto_value
=
NDB_FAILED_AUTO_INCREMENT
;
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
do
{
auto_value
=
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
);
}
while
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
&&
--
retries
&&
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
);
if
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
)
if
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
)
ERR_RETURN
(
ndb
->
getNdbError
());
ERR_RETURN
(
ndb
->
getNdbError
());
if
(
set_hidden_key
(
op
,
table
->
fields
,
(
const
byte
*
)
&
auto_value
))
if
(
set_hidden_key
(
op
,
table
->
fields
,
(
const
byte
*
)
&
auto_value
))
...
@@ -3974,10 +3981,16 @@ longlong ha_ndbcluster::get_auto_increment()
...
@@ -3974,10 +3981,16 @@ longlong ha_ndbcluster::get_auto_increment()
:
(
m_rows_to_insert
>
m_autoincrement_prefetch
)
?
:
(
m_rows_to_insert
>
m_autoincrement_prefetch
)
?
m_rows_to_insert
m_rows_to_insert
:
m_autoincrement_prefetch
;
:
m_autoincrement_prefetch
;
Uint64
auto_value
=
Uint64
auto_value
=
NDB_FAILED_AUTO_INCREMENT
;
(
m_skip_auto_increment
)
?
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
ndb
->
readAutoIncrementValue
((
const
NDBTAB
*
)
m_table
)
do
{
:
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
,
cache_size
);
auto_value
=
(
m_skip_auto_increment
)
?
ndb
->
readAutoIncrementValue
((
const
NDBTAB
*
)
m_table
)
:
ndb
->
getAutoIncrementValue
((
const
NDBTAB
*
)
m_table
,
cache_size
);
}
while
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
&&
--
retries
&&
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
);
if
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
)
if
(
auto_value
==
NDB_FAILED_AUTO_INCREMENT
)
ERR_RETURN
(
ndb
->
getNdbError
());
ERR_RETURN
(
ndb
->
getNdbError
());
DBUG_RETURN
((
longlong
)
auto_value
);
DBUG_RETURN
((
longlong
)
auto_value
);
...
...
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