1 diff -ru mysql-5.0.84_p_orig/innobase/row/row0sel.c mysql-5.0.84/innobase/row/row0sel.c
2 --- mysql-5.0.84_p_orig/innobase/row/row0sel.c 2009-07-07 21:54:10.000000000 +0900
3 +++ mysql-5.0.84/innobase/row/row0sel.c 2009-08-28 09:28:56.000000000 +0900
8 +/**********************************************************************
9 +Returns true if the thread is executing a SELECT statement.
10 +(Prototype for global functions in ha_innodb.cc) */
14 + /* out: true if thd is executing SELECT */
15 + const void* thd); /* in: thread handle (THD*) */
17 /************************************************************************
18 Searches for rows in the database. This is used in the interface to
19 MySQL. This function opens a cursor, and also implements fetch next
20 @@ -3361,20 +3370,12 @@
22 if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
23 && prebuilt->select_lock_type != LOCK_NONE
24 - && trx->mysql_query_str) {
26 - /* Scan the MySQL query string; check if SELECT is the first
30 - dict_accept(*trx->mysql_query_str, "SELECT", &success);
33 + && trx->mysql_thd != NULL
34 + && thd_is_select(trx->mysql_thd)) {
35 /* It is a plain locking SELECT and the isolation
36 level is low: do not lock gaps */
38 set_also_gap_locks = FALSE;
42 /* Note that if the search mode was GE or G, then the cursor
43 diff -ru mysql-5.0.84_p_orig/sql/ha_innodb.cc mysql-5.0.84/sql/ha_innodb.cc
44 --- mysql-5.0.84_p_orig/sql/ha_innodb.cc 2009-08-27 16:06:21.000000000 +0900
45 +++ mysql-5.0.84/sql/ha_innodb.cc 2009-08-28 09:33:38.000000000 +0900
50 +/**********************************************************************
51 +Returns true if the thread is executing a SELECT statement. */
56 + /* out: true if thd is executing SELECT */
57 + const void* thd) /* in: thread handle (THD*) */
59 + return(((const THD*) thd)->lex->sql_command == SQLCOM_SELECT);
62 /************************************************************************
63 Call this function when mysqld passes control to the client. That is to
64 avoid deadlocks on the adaptive hash S-latch possibly held by thd. For more