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
49596271
Commit
49596271
authored
Mar 01, 2006
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new
parents
54bbc4ab
500fa826
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
13 deletions
+28
-13
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+5
-2
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+20
-10
sql/ha_ndbcluster_binlog.h
sql/ha_ndbcluster_binlog.h
+3
-1
No files found.
sql/ha_ndbcluster.cc
View file @
49596271
...
...
@@ -4728,13 +4728,14 @@ int ha_ndbcluster::final_drop_index(TABLE *table_arg)
int
ha_ndbcluster
::
rename_table
(
const
char
*
from
,
const
char
*
to
)
{
NDBDICT
*
dict
;
char
old_dbname
[
FN_HEADLEN
];
char
new_tabname
[
FN_HEADLEN
];
const
NDBTAB
*
orig_tab
;
int
result
;
DBUG_ENTER
(
"ha_ndbcluster::rename_table"
);
DBUG_PRINT
(
"info"
,
(
"Renaming %s to %s"
,
from
,
to
));
set_dbname
(
from
);
set_dbname
(
from
,
old_dbname
);
set_tabname
(
from
);
set_tabname
(
to
,
new_tabname
);
...
...
@@ -4742,6 +4743,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
DBUG_RETURN
(
my_errno
=
HA_ERR_NO_CONNECTION
);
Ndb
*
ndb
=
get_ndb
();
ndb
->
setDatabaseName
(
old_dbname
);
dict
=
ndb
->
getDictionary
();
if
(
!
(
orig_tab
=
dict
->
getTable
(
m_tabname
)))
ERR_RETURN
(
dict
->
getNdbError
());
...
...
@@ -4833,7 +4835,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
current_thd
->
query
,
current_thd
->
query_length
,
m_dbname
,
new_tabname
,
0
,
0
,
SOT_RENAME_TABLE
);
SOT_RENAME_TABLE
,
old_dbname
,
m_tabname
);
}
if
(
share
)
free_share
(
&
share
);
...
...
sql/ha_ndbcluster_binlog.cc
View file @
49596271
...
...
@@ -885,7 +885,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
const
char
*
db
,
const
char
*
table_name
,
uint32
ndb_table_id
,
uint32
ndb_table_version
,
enum
SCHEMA_OP_TYPE
type
)
enum
SCHEMA_OP_TYPE
type
,
const
char
*
old_db
,
const
char
*
old_table_name
)
{
DBUG_ENTER
(
"ndbcluster_log_schema_op"
);
Thd_ndb
*
thd_ndb
=
get_thd_ndb
(
thd
);
...
...
@@ -919,10 +920,19 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
query
=
tmp_buf2
;
query_length
=
(
uint
)
(
strxmov
(
tmp_buf2
,
"drop table `"
,
table_name
,
"`"
,
NullS
)
-
tmp_buf2
);
// fall through
case
SOT_CREATE_TABLE
:
// fall through
if
(
!
share
)
get_a_share
=
1
;
break
;
case
SOT_RENAME_TABLE
:
/* redo the rename table query as is may contain several tables */
query
=
tmp_buf2
;
query_length
=
(
uint
)
(
strxmov
(
tmp_buf2
,
"rename table `"
,
old_db
,
"."
,
old_table_name
,
"` to `"
,
db
,
"."
,
table_name
,
"`"
,
NullS
)
-
tmp_buf2
);
if
(
!
share
)
get_a_share
=
1
;
break
;
case
SOT_CREATE_TABLE
:
// fall through
case
SOT_ALTER_TABLE
:
if
(
!
share
)
...
...
@@ -983,8 +993,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
}
Ndb
*
ndb
=
thd_ndb
->
ndb
;
char
old
_db
[
FN_REFLEN
];
strcpy
(
old
_db
,
ndb
->
getDatabaseName
());
char
save
_db
[
FN_REFLEN
];
strcpy
(
save
_db
,
ndb
->
getDatabaseName
());
char
tmp_buf
[
SCHEMA_QUERY_SIZE
];
NDBDICT
*
dict
=
ndb
->
getDictionary
();
...
...
@@ -1091,7 +1101,7 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
if
(
trans
)
ndb
->
closeTransaction
(
trans
);
ndb
->
setDatabaseName
(
old
_db
);
ndb
->
setDatabaseName
(
save
_db
);
/*
Wait for other mysqld's to acknowledge the table operation
...
...
@@ -1169,8 +1179,8 @@ ndbcluster_update_slock(THD *thd,
const
NdbError
*
ndb_error
=
0
;
uint32
node_id
=
g_ndb_cluster_connection
->
node_id
();
Ndb
*
ndb
=
check_ndb_in_thd
(
thd
);
char
old_db
[
128
];
strcpy
(
old
_db
,
ndb
->
getDatabaseName
());
char
save_db
[
FN_HEADLEN
];
strcpy
(
save
_db
,
ndb
->
getDatabaseName
());
char
tmp_buf
[
SCHEMA_QUERY_SIZE
];
NDBDICT
*
dict
=
ndb
->
getDictionary
();
...
...
@@ -1292,7 +1302,7 @@ ndbcluster_update_slock(THD *thd,
db
,
table_name
);
if
(
trans
)
ndb
->
closeTransaction
(
trans
);
ndb
->
setDatabaseName
(
old
_db
);
ndb
->
setDatabaseName
(
save
_db
);
DBUG_RETURN
(
0
);
}
...
...
sql/ha_ndbcluster_binlog.h
View file @
49596271
...
...
@@ -95,7 +95,9 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
const
char
*
db
,
const
char
*
table_name
,
uint32
ndb_table_id
,
uint32
ndb_table_version
,
enum
SCHEMA_OP_TYPE
type
);
enum
SCHEMA_OP_TYPE
type
,
const
char
*
old_db
=
0
,
const
char
*
old_table_name
=
0
);
int
ndbcluster_handle_drop_table
(
Ndb
*
ndb
,
const
char
*
event_name
,
NDB_SHARE
*
share
);
void
ndb_rep_event_name
(
String
*
event_name
,
...
...
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