]>
Commit | Line | Data |
---|---|---|
5b9e9ff4 ER |
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 | |
4 | @@ -2988,6 +2988,15 @@ | |
5 | return(SEL_FOUND); | |
6 | } | |
7 | ||
8 | +/********************************************************************** | |
9 | +Returns true if the thread is executing a SELECT statement. | |
10 | +(Prototype for global functions in ha_innodb.cc) */ | |
11 | +ibool | |
12 | +thd_is_select( | |
13 | +/*==========*/ | |
14 | + /* out: true if thd is executing SELECT */ | |
15 | + const void* thd); /* in: thread handle (THD*) */ | |
16 | + | |
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 @@ | |
21 | ||
22 | if (trx->isolation_level <= TRX_ISO_READ_COMMITTED | |
23 | && prebuilt->select_lock_type != LOCK_NONE | |
24 | - && trx->mysql_query_str) { | |
25 | - | |
26 | - /* Scan the MySQL query string; check if SELECT is the first | |
27 | - word there */ | |
28 | - ibool success; | |
29 | - | |
30 | - dict_accept(*trx->mysql_query_str, "SELECT", &success); | |
31 | - | |
32 | - if (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 */ | |
37 | ||
38 | set_also_gap_locks = FALSE; | |
39 | - } | |
40 | } | |
41 | ||
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 | |
46 | @@ -394,6 +394,18 @@ | |
47 | } | |
48 | } | |
49 | ||
50 | +/********************************************************************** | |
51 | +Returns true if the thread is executing a SELECT statement. */ | |
52 | +extern "C" | |
53 | +ibool | |
54 | +thd_is_select( | |
55 | +/*==========*/ | |
56 | + /* out: true if thd is executing SELECT */ | |
57 | + const void* thd) /* in: thread handle (THD*) */ | |
58 | +{ | |
59 | + return(((const THD*) thd)->lex->sql_command == SQLCOM_SELECT); | |
60 | +} | |
61 | + | |
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 |