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
1f142262
Commit
1f142262
authored
Mar 21, 2002
by
heikki@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql_show.cc, handler.h, handler.cc:
Add foreign key defs to SHOW CREATE TABLE
parent
e90a57aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
sql/handler.cc
sql/handler.cc
+2
-3
sql/handler.h
sql/handler.h
+3
-1
sql/sql_show.cc
sql/sql_show.cc
+13
-1
No files found.
sql/handler.cc
View file @
1f142262
...
...
@@ -260,13 +260,13 @@ int ha_autocommit_or_rollback(THD *thd, int error)
/*
This function is called when MySQL writes the log segment of a
transaction to the binlog. It is called when the LOCK_log mutex is
reserved. Here we communicate to transactional table handlers wh
ta
reserved. Here we communicate to transactional table handlers wh
at
binlog position corresponds to the current transaction. The handler
can store it and in recovery print to the user, so that the user
knows from what position in the binlog to start possible
roll-forward, for example, if the crashed server was a slave in
replication. This function also calls the commit of the table
handler, because the order of tra
sn
actions in the log of the table
handler, because the order of tra
ns
actions in the log of the table
handler must be the same as in the binlog.
arguments:
...
...
@@ -298,7 +298,6 @@ int ha_report_binlog_offset_and_commit(THD *thd,
return
error
;
}
int
ha_commit_trans
(
THD
*
thd
,
THD_TRANS
*
trans
)
{
int
error
=
0
;
...
...
sql/handler.h
View file @
1f142262
...
...
@@ -294,7 +294,9 @@ class handler :public Sql_alloc
virtual
char
*
update_table_comment
(
const
char
*
comment
)
{
return
(
char
*
)
comment
;}
virtual
void
append_create_info
(
String
*
packet
)
{}
virtual
char
*
get_foreign_key_create_info
()
{
return
(
NULL
);}
/* gets foreign key create string from InnoDB */
virtual
void
free_foreign_key_create_info
(
char
*
str
)
{}
/* The following can be called without an open handler */
virtual
const
char
*
table_type
()
const
=
0
;
virtual
const
char
**
bas_ext
()
const
=
0
;
...
...
sql/sql_show.cc
View file @
1f142262
...
...
@@ -889,9 +889,21 @@ store_create_info(THD *thd, TABLE *table, String *packet)
}
packet
->
append
(
')'
);
}
packet
->
append
(
"
\n
)"
,
2
);
handler
*
file
=
table
->
file
;
/* Get possible foreign key definitions stored in InnoDB and append them
to the CREATE TABLE statement */
char
*
for_str
=
file
->
get_foreign_key_create_info
();
if
(
for_str
)
{
packet
->
append
(
for_str
,
strlen
(
for_str
));
file
->
free_foreign_key_create_info
(
for_str
);
}
packet
->
append
(
"
\n
)"
,
2
);
packet
->
append
(
" TYPE="
,
6
);
packet
->
append
(
file
->
table_type
());
char
buff
[
128
];
...
...
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