summaryrefslogtreecommitdiff
path: root/innobase/row
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-01-13 04:05:38 +0200
committerunknown <heikki@hundin.mysql.fi>2004-01-13 04:05:38 +0200
commitea854327159c22dc811c9b64131918c694f49ae6 (patch)
tree5e24dfc6662002728ab2e9715e24f8769e411207 /innobase/row
parentfff44f71fa53e674b9ce4aa2a228db4e88f49ca5 (diff)
downloadmariadb-git-ea854327159c22dc811c9b64131918c694f49ae6.tar.gz
row0sel.c:
If MySQL tries to do SELECT from an InnoDB table, but has set no table locks at all in ::external_lock(), print a descriptive error message and assert; some subquery bugs were of this type innobase/row/row0sel.c: If MySQL tries to do SELECT from an InnoDB table, but has set no table locks at all in ::external_lock(), print a descriptive error message and assert; some subquery bugs were of this type
Diffstat (limited to 'innobase/row')
-rw-r--r--innobase/row/row0sel.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 2215e3feff8..a13aaa47af2 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2758,6 +2758,7 @@ row_search_for_mysql(
ulint cnt = 0;
ulint next_offs;
mtr_t mtr;
+ char err_buf[1000];
ut_ad(index && pcur && search_tuple);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
@@ -2773,6 +2774,17 @@ row_search_for_mysql(
ut_a(0);
}
+ if (trx->n_mysql_tables_in_use == 0) {
+
+ trx_print(err_buf, trx);
+
+ fprintf(stderr,
+"InnoDB: Error: MySQL is trying to perform a SELECT\n"
+"InnoDB: but it has not locked any tables in ::external_lock()!\n%s\n",
+ err_buf);
+ ut_a(0);
+ }
+
/* printf("Match mode %lu\n search tuple ", match_mode);
dtuple_print(search_tuple);
@@ -3072,6 +3084,16 @@ shortcut_fails_too_big_rec:
if (!prebuilt->sql_stat_start) {
/* No need to set an intention lock or assign a read view */
+ if (trx->read_view == NULL
+ && prebuilt->select_lock_type == LOCK_NONE) {
+ trx_print(err_buf, trx);
+
+ fprintf(stderr,
+"InnoDB: Error: MySQL is trying to perform a consistent read\n"
+"InnoDB: but the read view is not assigned!\n%s\n", err_buf);
+
+ ut_a(0);
+ }
} else if (prebuilt->select_lock_type == LOCK_NONE) {
/* This is a consistent read */
/* Assign a read view for the query */