--- rw-splitting.lua.orig 2008-05-04 10:03:25.000000000 +0200 +++ rw-splitting.lua 2008-05-04 10:03:25.000000000 +0200 @@ -222,7 +222,7 @@ function read_query( packet ) if not is_in_select_calc_found_rows and token.token_name == "TK_SQL_SQL_CALC_FOUND_ROWS" then is_in_select_calc_found_rows = true - elseif not is_insert_id and token.token_name == "TK_LITERAL" then + elseif not is_insert_id and (token.token_name == "TK_LITERAL" or token.token_name == "TK_FUNCTION") then local utext = token.text:upper() if utext == "LAST_INSERT_ID" or