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
05a86e10
Commit
05a86e10
authored
May 14, 2007
by
tomas@whalegate.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
parents
836597bb
9bbd51e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
25 deletions
+35
-25
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+35
-25
No files found.
sql/ha_ndbcluster.cc
View file @
05a86e10
...
@@ -2731,18 +2731,25 @@ int ha_ndbcluster::write_row(byte *record)
...
@@ -2731,18 +2731,25 @@ 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
();
int
ret
;
Uint64
auto_value
;
Uint64
auto_value
;
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
do
{
int
retry_sleep
=
30
;
/* 30 milliseconds, transaction */
for
(;;)
{
Ndb_tuple_id_range_guard
g
(
m_share
);
Ndb_tuple_id_range_guard
g
(
m_share
);
ret
=
ndb
->
getAutoIncrementValue
(
m_table
,
g
.
range
,
auto_value
,
1
);
if
(
ndb
->
getAutoIncrementValue
(
m_table
,
g
.
range
,
auto_value
,
1
)
==
-
1
)
}
while
(
ret
==
-
1
&&
{
--
retries
&&
if
(
--
retries
&&
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
);
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
);
if
(
ret
==
-
1
)
{
ERR_RETURN
(
ndb
->
getNdbError
());
my_sleep
(
retry_sleep
);
if
(
set_hidden_key
(
op
,
table_share
->
fields
,
(
const
byte
*
)
&
auto_value
))
continue
;
}
ERR_RETURN
(
ndb
->
getNdbError
());
}
break
;
}
if
(
set_hidden_key
(
op
,
table
->
s
->
fields
,
(
const
byte
*
)
&
auto_value
))
ERR_RETURN
(
op
->
getNdbError
());
ERR_RETURN
(
op
->
getNdbError
());
}
}
else
else
...
@@ -6064,24 +6071,27 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
...
@@ -6064,24 +6071,27 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
m_rows_to_insert
-
m_rows_inserted
:
m_rows_to_insert
-
m_rows_inserted
:
((
m_rows_to_insert
>
m_autoincrement_prefetch
)
?
((
m_rows_to_insert
>
m_autoincrement_prefetch
)
?
m_rows_to_insert
:
m_autoincrement_prefetch
));
m_rows_to_insert
:
m_autoincrement_prefetch
));
int
ret
;
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
uint
retries
=
NDB_AUTO_INCREMENT_RETRIES
;
do
{
int
retry_sleep
=
30
;
/* 30 milliseconds, transaction */
for
(;;)
{
Ndb_tuple_id_range_guard
g
(
m_share
);
Ndb_tuple_id_range_guard
g
(
m_share
);
ret
=
if
(
m_skip_auto_increment
&&
m_skip_auto_increment
?
ndb
->
readAutoIncrementValue
(
m_table
,
g
.
range
,
auto_value
)
||
ndb
->
readAutoIncrementValue
(
m_table
,
g
.
range
,
auto_value
)
:
ndb
->
getAutoIncrementValue
(
m_table
,
g
.
range
,
auto_value
,
cache_size
))
ndb
->
getAutoIncrementValue
(
m_table
,
g
.
range
,
auto_value
,
cache_size
);
{
}
while
(
ret
==
-
1
&&
if
(
--
retries
&&
--
retries
&&
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
);
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
);
{
if
(
ret
==
-
1
)
my_sleep
(
retry_sleep
);
{
continue
;
const
NdbError
err
=
ndb
->
getNdbError
();
}
sql_print_error
(
"Error %lu in ::get_auto_increment(): %s"
,
const
NdbError
err
=
ndb
->
getNdbError
();
(
ulong
)
err
.
code
,
err
.
message
);
sql_print_error
(
"Error %lu in ::get_auto_increment(): %s"
,
*
first_value
=
~
(
ulonglong
)
0
;
(
ulong
)
err
.
code
,
err
.
message
);
DBUG_VOID_RETURN
;
DBUG_RETURN
(
~
(
ulonglong
)
0
);
}
break
;
}
}
*
first_value
=
(
longlong
)
auto_value
;
*
first_value
=
(
longlong
)
auto_value
;
/* From the point of view of MySQL, NDB reserves one row at a time */
/* From the point of view of MySQL, NDB reserves one row at a time */
...
...
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