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
43c2f83e
Commit
43c2f83e
authored
Aug 29, 2001
by
heikki@donna.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ha_innobase.cc Fix a bug in connection with SET INSERT_ID:caused repliaction to fail
parent
2adf2fad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
1 deletion
+57
-1
sql/ha_innobase.cc
sql/ha_innobase.cc
+57
-1
No files found.
sql/ha_innobase.cc
View file @
43c2f83e
...
@@ -180,6 +180,50 @@ convert_error_code_to_mysql(
...
@@ -180,6 +180,50 @@ convert_error_code_to_mysql(
}
}
}
}
extern
"C"
{
/*****************************************************************
Prints info of a THD object (== user session thread) to the
standatd output. NOTE that mysql/innobase/trx/trx0trx.c must contain
the prototype for this function! */
void
innobase_mysql_print_thd
(
/*=====================*/
void
*
input_thd
)
/* in: pointer to a MySQL THD object */
{
THD
*
thd
;
thd
=
(
THD
*
)
input_thd
;
printf
(
"MySQL thread id %lu, query id %lu"
,
thd
->
thread_id
,
thd
->
query_id
);
if
(
thd
->
host
)
{
printf
(
" %s"
,
thd
->
host
);
}
if
(
thd
->
ip
)
{
printf
(
" %s"
,
thd
->
ip
);
}
if
(
thd
->
user
)
{
printf
(
" %s"
,
thd
->
user
);
}
if
(
thd
->
proc_info
)
{
printf
(
" %s"
,
thd
->
proc_info
);
}
if
(
thd
->
query
)
{
printf
(
" %50.50s"
,
thd
->
query
);
}
printf
(
"
\n
"
);
}
}
/*************************************************************************
/*************************************************************************
Gets the InnoDB transaction handle for a MySQL handler object, creates
Gets the InnoDB transaction handle for a MySQL handler object, creates
an InnoDB transaction struct if the corresponding MySQL thread struct still
an InnoDB transaction struct if the corresponding MySQL thread struct still
...
@@ -199,6 +243,8 @@ check_trx_exists(
...
@@ -199,6 +243,8 @@ check_trx_exists(
dbug_assert
(
thd
!=
NULL
);
dbug_assert
(
thd
!=
NULL
);
trx
=
trx_allocate_for_mysql
();
trx
=
trx_allocate_for_mysql
();
trx
->
mysql_thd
=
thd
;
thd
->
transaction
.
all
.
innobase_tid
=
trx
;
thd
->
transaction
.
all
.
innobase_tid
=
trx
;
/* The execution of a single SQL statement is denoted by
/* The execution of a single SQL statement is denoted by
...
@@ -633,7 +679,7 @@ innobase_commit(
...
@@ -633,7 +679,7 @@ innobase_commit(
if
(
trx_handle
!=
(
void
*
)
&
innodb_dummy_stmt_trx_handle
)
{
if
(
trx_handle
!=
(
void
*
)
&
innodb_dummy_stmt_trx_handle
)
{
trx_commit_for_mysql
(
trx
);
trx_commit_for_mysql
(
trx
);
trx_mark_sql_stat_end
(
trx
);
trx_mark_sql_stat_end
_do_not_start_new
(
trx
);
}
else
{
}
else
{
trx_mark_sql_stat_end
(
trx
);
trx_mark_sql_stat_end
(
trx
);
}
}
...
@@ -672,6 +718,7 @@ innobase_rollback(
...
@@ -672,6 +718,7 @@ innobase_rollback(
if
(
trx_handle
!=
(
void
*
)
&
innodb_dummy_stmt_trx_handle
)
{
if
(
trx_handle
!=
(
void
*
)
&
innodb_dummy_stmt_trx_handle
)
{
error
=
trx_rollback_for_mysql
(
trx
);
error
=
trx_rollback_for_mysql
(
trx
);
trx_mark_sql_stat_end_do_not_start_new
(
trx
);
}
else
{
}
else
{
error
=
trx_rollback_last_sql_stat_for_mysql
(
trx
);
error
=
trx_rollback_last_sql_stat_for_mysql
(
trx
);
trx_mark_sql_stat_end
(
trx
);
trx_mark_sql_stat_end
(
trx
);
...
@@ -1335,6 +1382,15 @@ ha_innobase::write_row(
...
@@ -1335,6 +1382,15 @@ ha_innobase::write_row(
auto_inc
=
table
->
next_number_field
->
val_int
();
auto_inc
=
table
->
next_number_field
->
val_int
();
/* In replication and also otherwise the auto-inc column
can be set with SET INSERT_ID. Then we must look at
user_thd->next_insert_id. If it is nonzero and the user
has not supplied a value, we must use it. */
if
(
auto_inc
==
0
&&
user_thd
->
next_insert_id
!=
0
)
{
auto_inc
=
user_thd
->
next_insert_id
;
}
if
(
auto_inc
!=
0
)
{
if
(
auto_inc
!=
0
)
{
/* This call will calculate the max of the
/* This call will calculate the max of the
current value and the value supplied by the user, if
current value and the value supplied by the user, if
...
...
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