#At file:///home/msvensson/mysql/7.0/ based on revid:magnus.blaudd@stripped
3977 Magnus Blåudd 2010-11-09
ndb
- add wrapper for getting pointer to threads diagnostic area
modified:
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_glue.h
=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc 2010-11-08 16:18:41 +0000
+++ b/sql/ha_ndbcluster_binlog.cc 2010-11-09 12:12:59 +0000
@@ -587,9 +587,9 @@ static int ndbcluster_reset_logs(THD *th
so reset state if not an error as not to hit asserts
in upper layers
*/
- while (thd->main_da.is_error())
+ while (thd_stmt_da(thd)->is_error())
{
- if (thd->main_da.sql_errno() == ER_NO_SUCH_TABLE)
+ if (thd_stmt_da(thd)->sql_errno() == ER_NO_SUCH_TABLE)
{
/*
If table does not exist ignore the error as it
@@ -599,7 +599,7 @@ static int ndbcluster_reset_logs(THD *th
}
DBUG_RETURN(1);
}
- thd->main_da.reset_diagnostics_area();
+ thd_stmt_da(thd)->reset_diagnostics_area();
DBUG_RETURN(0);
}
@@ -693,14 +693,14 @@ ndbcluster_binlog_index_purge_file(THD *
" WHERE File='"), file), "'");
run_query(thd, buf, end, NULL, TRUE, FALSE);
- if (thd->main_da.is_error() &&
- thd->main_da.sql_errno() == ER_NO_SUCH_TABLE)
+ if (thd_stmt_da(thd)->is_error() &&
+ thd_stmt_da(thd)->sql_errno() == ER_NO_SUCH_TABLE)
{
/*
If table does not exist ignore the error as it
is a consistant behavior
*/
- thd->main_da.reset_diagnostics_area();
+ thd_stmt_da(thd)->reset_diagnostics_area();
}
if (save_thd == 0)
@@ -836,14 +836,14 @@ static void ndbcluster_reset_slave(THD *
char buf[1024];
char *end= strmov(buf, "DELETE FROM " NDB_REP_DB "." NDB_APPLY_TABLE);
run_query(thd, buf, end, NULL, TRUE, FALSE);
- if (thd->main_da.is_error() &&
- ((thd->main_da.sql_errno() == ER_NO_SUCH_TABLE)))
+ if (thd_stmt_da(thd)->is_error() &&
+ ((thd_stmt_da(thd)->sql_errno() == ER_NO_SUCH_TABLE)))
{
/*
If table does not exist ignore the error as it
is a consistant behavior
*/
- thd->main_da.reset_diagnostics_area();
+ thd_stmt_da(thd)->reset_diagnostics_area();
}
DBUG_VOID_RETURN;
@@ -3418,8 +3418,8 @@ static int open_and_lock_ndb_binlog_inde
sql_print_error("NDB Binlog: Opening ndb_binlog_index: killed");
else
sql_print_error("NDB Binlog: Opening ndb_binlog_index: %d, '%s'",
- thd->main_da.sql_errno(),
- thd->main_da.message());
+ thd_stmt_da(thd)->sql_errno(),
+ thd_stmt_da(thd)->message());
thd->proc_info= save_proc_info;
return -1;
}
=== modified file 'sql/ha_ndbcluster_glue.h'
--- a/sql/ha_ndbcluster_glue.h 2010-11-08 16:34:07 +0000
+++ b/sql/ha_ndbcluster_glue.h 2010-11-09 12:12:59 +0000
@@ -122,6 +122,17 @@ ulonglong thd_options(const THD * thd)
#endif
}
+/* get pointer to diagnostic area for statement from THD */
+static inline
+Diagnostics_area* thd_stmt_da(THD* thd)
+{
+#if MYSQL_VERSION_ID < 50500
+ return &(thd->main_da);
+#else
+ /* "main_da" has been made private and one should use "stmt_da*" */
+ return thd->stmt_da;
+#endif
+}
/* extract the list of warnings from THD */
static inline
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20101109121259-he3a8lr17yw19xzr.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3977) | Magnus Blåudd | 9 Nov |