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
852c0dbf
Commit
852c0dbf
authored
May 16, 2006
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/space/pekka/ndb/version/my50-bug14509
into mysql.com:/space/pekka/ndb/version/my51-bug14509
parents
d0d8b6c9
dd58dd51
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
32 deletions
+31
-32
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+5
-5
storage/ndb/include/ndbapi/Ndb.hpp
storage/ndb/include/ndbapi/Ndb.hpp
+6
-6
storage/ndb/src/ndbapi/Ndb.cpp
storage/ndb/src/ndbapi/Ndb.cpp
+19
-20
storage/ndb/tools/restore/consumer_restore.cpp
storage/ndb/tools/restore/consumer_restore.cpp
+1
-1
No files found.
sql/ha_ndbcluster.cc
View file @
852c0dbf
...
...
@@ -2563,11 +2563,11 @@ int ha_ndbcluster::write_row(byte *record)
Ndb
*
ndb
=
get_ndb
();
Uint64
next_val
=
(
Uint64
)
table
->
next_number_field
->
val_int
()
+
1
;
DBUG_PRINT
(
"info"
,
(
"Trying to set next auto increment value to %lu"
,
(
ulong
)
next_val
));
if
(
ndb
->
setAutoIncrementValue
(
m_table
,
next_val
,
TRUE
)
)
DBUG_PRINT
(
"info"
,
(
"Setting next auto increment value to %u"
,
next_val
));
(
"Trying to set next auto increment value to %l
l
u"
,
(
ulong
long
)
next_val
));
if
(
ndb
->
setAutoIncrementValue
(
m_table
,
next_val
,
TRUE
)
==
~
(
Uint64
)
0
)
ERR_RETURN
(
ndb
->
getNdbError
());
}
m_skip_auto_increment
=
TRUE
;
...
...
storage/ndb/include/ndbapi/Ndb.hpp
View file @
852c0dbf
...
...
@@ -1469,7 +1469,7 @@ public:
*
* @param cacheSize number of values to cache in this Ndb object
*
* @return tuple id or
0 on error
* @return tuple id or
~(Uint64)0 on error.
*/
int
initAutoIncrement
();
...
...
@@ -1479,14 +1479,14 @@ public:
Uint32
cacheSize
=
1
);
Uint64
readAutoIncrementValue
(
const
char
*
aTableName
);
Uint64
readAutoIncrementValue
(
const
NdbDictionary
::
Table
*
aTable
);
bool
setAutoIncrementValue
(
const
char
*
aTableName
,
Uint64
val
,
bool
increase
=
false
);
bool
setAutoIncrementValue
(
const
NdbDictionary
::
Table
*
aTable
,
Uint64
val
,
bool
increase
=
false
);
Uint64
setAutoIncrementValue
(
const
char
*
aTableName
,
Uint64
val
,
bool
increase
=
false
);
Uint64
setAutoIncrementValue
(
const
NdbDictionary
::
Table
*
aTable
,
Uint64
val
,
bool
increase
=
false
);
private:
Uint64
getTupleIdFromNdb
(
Ndb_local_table_info
*
info
,
Uint32
cacheSize
);
Uint64
readTupleIdFromNdb
(
Ndb_local_table_info
*
info
);
bool
setTupleIdInNdb
(
Ndb_local_table_info
*
info
,
Uint64
val
,
bool
increase
);
Uint64
setTupleIdInNdb
(
Ndb_local_table_info
*
info
,
Uint64
val
,
bool
increase
);
Uint64
opTupleIdOnNdb
(
Ndb_local_table_info
*
info
,
Uint64
opValue
,
Uint32
op
);
public:
...
...
storage/ndb/src/ndbapi/Ndb.cpp
View file @
852c0dbf
...
...
@@ -768,8 +768,7 @@ Uint64
Ndb
::
getAutoIncrementValue
(
const
NdbDictionary
::
Table
*
aTable
,
Uint32
cacheSize
)
{
DBUG_ENTER
(
"getAutoIncrementValue"
);
if
(
aTable
==
0
)
DBUG_RETURN
(
~
(
Uint64
)
0
);
assert
(
aTable
!=
0
);
const
NdbTableImpl
*
table
=
&
NdbTableImpl
::
getImpl
(
*
aTable
);
const
BaseString
&
internal_tabname
=
table
->
m_internalName
;
...
...
@@ -830,8 +829,7 @@ Uint64
Ndb
::
readAutoIncrementValue
(
const
NdbDictionary
::
Table
*
aTable
)
{
DBUG_ENTER
(
"readAutoIncrementValue"
);
if
(
aTable
==
0
)
DBUG_RETURN
(
~
(
Uint64
)
0
);
assert
(
aTable
!=
0
);
const
NdbTableImpl
*
table
=
&
NdbTableImpl
::
getImpl
(
*
aTable
);
const
BaseString
&
internal_tabname
=
table
->
m_internalName
;
...
...
@@ -867,7 +865,7 @@ Ndb::readTupleIdFromNdb(Ndb_local_table_info* info)
DBUG_RETURN
(
tupleId
);
}
bool
Uint64
Ndb
::
setAutoIncrementValue
(
const
char
*
aTableName
,
Uint64
val
,
bool
increase
)
{
DBUG_ENTER
(
"setAutoIncrementValue"
);
...
...
@@ -877,17 +875,16 @@ Ndb::setAutoIncrementValue(const char* aTableName, Uint64 val, bool increase)
theDictionary
->
get_local_table_info
(
internal_tabname
);
if
(
info
==
0
)
{
theError
.
code
=
theDictionary
->
getNdbError
().
code
;
DBUG_RETURN
(
false
);
DBUG_RETURN
(
~
(
Uint64
)
0
);
}
DBUG_RETURN
(
setTupleIdInNdb
(
info
,
val
,
increase
));
}
bool
Uint64
Ndb
::
setAutoIncrementValue
(
const
NdbDictionary
::
Table
*
aTable
,
Uint64
val
,
bool
increase
)
{
DBUG_ENTER
(
"setAutoIncrementValue"
);
if
(
aTable
==
0
)
DBUG_RETURN
(
false
);
assert
(
aTable
!=
0
);
const
NdbTableImpl
*
table
=
&
NdbTableImpl
::
getImpl
(
*
aTable
);
const
BaseString
&
internal_tabname
=
table
->
m_internalName
;
...
...
@@ -895,12 +892,12 @@ Ndb::setAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 val, bool
theDictionary
->
get_local_table_info
(
internal_tabname
,
false
);
if
(
info
==
0
)
{
theError
.
code
=
theDictionary
->
getNdbError
().
code
;
DBUG_RETURN
(
false
);
DBUG_RETURN
(
~
(
Uint64
)
0
);
}
DBUG_RETURN
(
setTupleIdInNdb
(
info
,
val
,
increase
));
}
bool
Uint64
Ndb
::
setTupleIdInNdb
(
Ndb_local_table_info
*
info
,
Uint64
val
,
bool
increase
)
{
DBUG_ENTER
(
"setTupleIdInNdb"
);
...
...
@@ -910,11 +907,14 @@ Ndb::setTupleIdInNdb(Ndb_local_table_info* info, Uint64 val, bool increase)
{
assert
(
info
->
m_first_tuple_id
<
info
->
m_last_tuple_id
);
if
(
val
<=
info
->
m_first_tuple_id
+
1
)
DBUG_RETURN
(
false
);
DBUG_RETURN
(
val
);
if
(
val
<=
info
->
m_last_tuple_id
)
{
info
->
m_first_tuple_id
=
val
-
1
;
DBUG_RETURN
(
true
);
DBUG_PRINT
(
"info"
,
(
"Setting next auto increment cached value to %llu"
,
(
ulonglong
)
val
));
DBUG_RETURN
(
val
);
}
}
/*
...
...
@@ -962,8 +962,7 @@ Ndb::opTupleIdOnNdb(Ndb_local_table_info* info, Uint64 opValue, Uint32 op)
NdbOperation
*
tOperation
=
0
;
// Compiler warning if not initialized
Uint64
tValue
;
NdbRecAttr
*
tRecAttrResult
;
int
result
;
Uint64
ret
;
Uint64
ret
=
~
(
Uint64
)
0
;
CHECK_STATUS_MACRO_ZERO
;
...
...
@@ -1020,17 +1019,17 @@ Ndb::opTupleIdOnNdb(Ndb_local_table_info* info, Uint64 opValue, Uint32 op)
tOperation
->
def_label
(
0
);
tOperation
->
interpret_exit_nok
(
9999
);
if
(
(
result
=
tConnection
->
execute
(
Commit
))
==
-
1
)
if
(
tConnection
->
execute
(
Commit
)
==
-
1
)
{
if
(
tConnection
->
theError
.
code
!=
9999
)
goto
error_handler
;
// NEXTID >= opValue, return ~(Uint64)0 for now since
// there is no error check...
ret
=
~
(
Uint64
)
0
;
ret
=
opValue
;
}
else
{
DBUG_PRINT
(
"info"
,
(
"Setting next auto increment value (db) to %llu"
,
(
ulonglong
)
opValue
));
info
->
m_first_tuple_id
=
info
->
m_last_tuple_id
=
opValue
-
1
;
ret
=
opValue
;
}
...
...
storage/ndb/tools/restore/consumer_restore.cpp
View file @
852c0dbf
...
...
@@ -153,7 +153,7 @@ BackupRestore::finalize_table(const TableS & table){
Uint64
max_val
=
table
.
get_max_auto_val
();
Uint64
auto_val
=
m_ndb
->
readAutoIncrementValue
(
get_table
(
table
.
m_dictTable
));
if
(
max_val
+
1
>
auto_val
||
auto_val
==
~
(
Uint64
)
0
)
ret
=
m_ndb
->
setAutoIncrementValue
(
get_table
(
table
.
m_dictTable
),
max_val
+
1
,
false
);
ret
=
m_ndb
->
setAutoIncrementValue
(
get_table
(
table
.
m_dictTable
),
max_val
+
1
,
false
)
!=
~
(
Uint64
)
0
;
}
return
ret
;
}
...
...
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