File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 16
16
-- You should have received a copy of the GNU General Public License
17
17
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
19
+ use_sql_no_cache = 0
20
+
21
+ function nocache (query )
22
+ local word = string.upper (string.sub (query ,1 ,6 ))
23
+ if ( word == " SELECT" ) then
24
+ query = " SELECT SQL_NO_CACHE" .. query :sub (7 )
25
+ end
26
+ return query
27
+ end
28
+
19
29
transaction_counter = 0
20
30
21
31
function read_query ( packet )
22
32
if packet :byte () ~= proxy .COM_QUERY then
23
33
return
24
34
end
25
- proxy .queries :append (1 , string.char (proxy .COM_QUERY ) .. packet :sub (2 ), {resultset_is_needed = true })
35
+ local query = packet :sub (2 )
36
+ if ( use_sql_no_cache == 1 ) then
37
+ query = nocache (query )
38
+ end
39
+ proxy .queries :append (1 , string.char (proxy .COM_QUERY ) .. query , {resultset_is_needed = true })
26
40
27
41
return proxy .PROXY_SEND_QUERY
28
42
end
Original file line number Diff line number Diff line change 16
16
-- You should have received a copy of the GNU General Public License
17
17
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
19
+ use_sql_no_cache = 0
20
+
21
+ function nocache (query )
22
+ local word = string.upper (string.sub (query ,1 ,6 ))
23
+ if ( word == " SELECT" ) then
24
+ query = " SELECT SQL_NO_CACHE" .. query :sub (7 )
25
+ end
26
+ return query
27
+ end
28
+
19
29
transaction_counter = 0
20
30
21
31
function read_query ( packet )
22
32
if packet :byte () ~= proxy .COM_QUERY then
23
33
return
24
34
end
25
- proxy .queries :append (1 , string.char (proxy .COM_QUERY ) .. packet :sub (2 ), {resultset_is_needed = true })
35
+ local query = packet :sub (2 )
36
+ if ( use_sql_no_cache == 1 ) then
37
+ query = nocache (query )
38
+ end
39
+ proxy .queries :append (1 , string.char (proxy .COM_QUERY ) .. query , {resultset_is_needed = true })
26
40
27
41
return proxy .PROXY_SEND_QUERY
28
42
end
You can’t perform that action at this time.
0 commit comments