summaryrefslogtreecommitdiff
path: root/storage/innobase/handler
diff options
context:
space:
mode:
authorTimothy Smith <timothy.smith@sun.com>2008-12-14 12:28:19 -0700
committerTimothy Smith <timothy.smith@sun.com>2008-12-14 12:28:19 -0700
commit2450190eed67992c910615418137046ecfc0e2f4 (patch)
treedaa964ba3f9cffdebcdc032eecf2e99fe4e7c8d1 /storage/innobase/handler
parentf6bf85c09e54b8232697c3fa6c85a7d61599bf6b (diff)
downloadmariadb-git-2450190eed67992c910615418137046ecfc0e2f4.tar.gz
Apply InnoDB snapshot innodb-5.1-ss2637, part 1. Fixes
Bug #37885: row_search_for_mysql may gap lock unnecessarily with SQL comments in query Detailed revision comments: r2603 | marko | 2008-08-21 16:25:05 +0300 (Thu, 21 Aug 2008) | 10 lines branches/5.1: Identify SELECT statements by thd_sql_command() == SQLCOM_SELECT instead of parsing the query string. This fixes MySQL Bug #37885 without us having to implement lexical analysis of SQL comments in yet another place. thd_is_select(): A new predicate. row_search_for_mysql(): Use thd_is_select(). Approved by Heikki.
Diffstat (limited to 'storage/innobase/handler')
-rw-r--r--storage/innobase/handler/ha_innodb.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 4b7c5b1246a..8a8d9698ac1 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -507,6 +507,18 @@ thd_has_edited_nontrans_tables(
return((ibool) thd_non_transactional_update((THD*) thd));
}
+/**********************************************************************
+Returns true if the thread is executing a SELECT statement. */
+extern "C"
+ibool
+thd_is_select(
+/*==========*/
+ /* out: true if thd is executing SELECT */
+ const void* thd) /* in: thread handle (THD*) */
+{
+ return(thd_sql_command((const THD*) thd) == SQLCOM_SELECT);
+}
+
/************************************************************************
Obtain the InnoDB transaction of a MySQL thread. */
inline