-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub: fix #344 MySQL uses max_execution_time. MariaDB uses max_statement_time. Reported by Kazuhiko. Thanks!!!
- Loading branch information
Showing
14 changed files
with
337 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
mysql-test/mroonga/include/mroonga/have_groonga_12_0_9_or_later.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- mode: sql; sql-product: mysql -*- | ||
# | ||
# Copyright(C) 2022 Sutou Kouhei <kou@clear-code.com> | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
--source ../../include/mroonga/check_groonga_version.inc | ||
|
||
if (!$groonga_version_12_0_9_or_later) { | ||
--source ../../include/mroonga/have_mroonga_deinit.inc | ||
--skip This test is for Groonga version 12.0.9 or later | ||
} |
9 changes: 9 additions & 0 deletions
9
mysql-test/mroonga/storage/function/command/r/max_execution_time.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DROP TABLE IF EXISTS diaries; | ||
SET NAMES utf8mb4; | ||
CREATE TABLE diaries( | ||
title TEXT | ||
) DEFAULT CHARSET=utf8mb4; | ||
SELECT /*+ MAX_EXECUTION_TIME(1) */ | ||
mroonga_command('sleep', 'second', '1'); | ||
ERROR HY000: Query execution was interrupted, maximum statement execution time exceeded | ||
DROP TABLE diaries; |
9 changes: 9 additions & 0 deletions
9
mysql-test/mroonga/storage/function/command/r/max_statement_time.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DROP TABLE IF EXISTS diaries; | ||
SET NAMES utf8mb4; | ||
CREATE TABLE diaries( | ||
title TEXT | ||
) DEFAULT CHARSET=utf8mb4; | ||
SET STATEMENT max_statement_time = 0.001 FOR | ||
SELECT mroonga_command('sleep', 'second', '1'); | ||
ERROR 70100: Query execution was interrupted (max_statement_time exceeded) | ||
DROP TABLE diaries; |
41 changes: 41 additions & 0 deletions
41
mysql-test/mroonga/storage/function/command/t/max_execution_time.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- mode: sql; sql-product: mysql -*- | ||
# | ||
# Copyright(C) 2022 Sutou Kouhei <kou@clear-code.com> | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
--source ../../../../include/mroonga/have_mysql.inc | ||
--source ../../../../include/mroonga/not_embedded.inc | ||
--source ../../../../include/mroonga/have_mroonga.inc | ||
# --source ../../../../include/mroonga/have_groonga_12_0_9_or_later.inc | ||
--source ../../../../include/mroonga/load_mroonga_functions.inc | ||
|
||
--disable_warnings | ||
DROP TABLE IF EXISTS diaries; | ||
--enable_warnings | ||
|
||
SET NAMES utf8mb4; | ||
CREATE TABLE diaries( | ||
title TEXT | ||
) DEFAULT CHARSET=utf8mb4; | ||
|
||
--error ER_QUERY_TIMEOUT | ||
SELECT /*+ MAX_EXECUTION_TIME(1) */ | ||
mroonga_command('sleep', 'second', '1'); | ||
|
||
DROP TABLE diaries; | ||
|
||
--source ../../../../include/mroonga/unload_mroonga_functions.inc | ||
--source ../../../../include/mroonga/have_mroonga_deinit.inc |
41 changes: 41 additions & 0 deletions
41
mysql-test/mroonga/storage/function/command/t/max_statement_time.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- mode: sql; sql-product: mysql -*- | ||
# | ||
# Copyright(C) 2022 Sutou Kouhei <kou@clear-code.com> | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
--source ../../../../include/mroonga/have_mariadb.inc | ||
--source ../../../../include/mroonga/not_embedded.inc | ||
--source ../../../../include/mroonga/have_mroonga.inc | ||
# --source ../../../../include/mroonga/have_groonga_12_0_9_or_later.inc | ||
--source ../../../../include/mroonga/load_mroonga_functions.inc | ||
|
||
--disable_warnings | ||
DROP TABLE IF EXISTS diaries; | ||
--enable_warnings | ||
|
||
SET NAMES utf8mb4; | ||
CREATE TABLE diaries( | ||
title TEXT | ||
) DEFAULT CHARSET=utf8mb4; | ||
|
||
--error ER_STATEMENT_TIMEOUT | ||
SET STATEMENT max_statement_time = 0.001 FOR | ||
SELECT mroonga_command('sleep', 'second', '1'); | ||
|
||
DROP TABLE diaries; | ||
|
||
--source ../../../../include/mroonga/unload_mroonga_functions.inc | ||
--source ../../../../include/mroonga/have_mroonga_deinit.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DROP TABLE IF EXISTS diaries; | ||
SET NAMES utf8mb4; | ||
CREATE TABLE diaries( | ||
title TEXT | ||
) DEFAULT CHARSET=utf8mb4; | ||
SELECT /*+ MAX_EXECUTION_TIME(1) */ title, sleep(1) FROM diaries; | ||
ERROR HY000: Query execution was interrupted, maximum statement execution time exceeded | ||
DROP TABLE diaries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DROP TABLE IF EXISTS diaries; | ||
SET NAMES utf8mb4; | ||
CREATE TABLE diaries( | ||
title TEXT | ||
) DEFAULT CHARSET=utf8mb4; | ||
SET STATEMENT max_statement_time = 0.001 FOR | ||
SELECT title, sleep(1) FROM diaries; | ||
ERROR 70100: Query execution was interrupted (max_statement_time exceeded) | ||
DROP TABLE diaries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- mode: sql; sql-product: mysql -*- | ||
# | ||
# Copyright(C) 2022 Sutou Kouhei <kou@clear-code.com> | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
--source ../../include/mroonga/have_mysql.inc | ||
--source ../../include/mroonga/not_embedded.inc | ||
--source ../../include/mroonga/have_mroonga.inc | ||
# --source ../../include/mroonga/have_groonga_12_0_9_or_later.inc | ||
|
||
--disable_warnings | ||
DROP TABLE IF EXISTS diaries; | ||
--enable_warnings | ||
|
||
SET NAMES utf8mb4; | ||
CREATE TABLE diaries( | ||
title TEXT | ||
) DEFAULT CHARSET=utf8mb4; | ||
|
||
--error ER_QUERY_TIMEOUT | ||
SELECT /*+ MAX_EXECUTION_TIME(1) */ title, sleep(1) FROM diaries; | ||
|
||
DROP TABLE diaries; | ||
|
||
--source ../../include/mroonga/have_mroonga_deinit.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- mode: sql; sql-product: mysql -*- | ||
# | ||
# Copyright(C) 2022 Sutou Kouhei <kou@clear-code.com> | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
--source ../../include/mroonga/have_mariadb.inc | ||
--source ../../include/mroonga/not_embedded.inc | ||
--source ../../include/mroonga/have_mroonga.inc | ||
# --source ../../include/mroonga/have_groonga_12_0_9_or_later.inc | ||
|
||
--disable_warnings | ||
DROP TABLE IF EXISTS diaries; | ||
--enable_warnings | ||
|
||
SET NAMES utf8mb4; | ||
CREATE TABLE diaries( | ||
title TEXT | ||
) DEFAULT CHARSET=utf8mb4; | ||
|
||
--error ER_STATEMENT_TIMEOUT | ||
SET STATEMENT max_statement_time = 0.001 FOR | ||
SELECT title, sleep(1) FROM diaries; | ||
|
||
DROP TABLE diaries; | ||
|
||
--source ../../include/mroonga/have_mroonga_deinit.inc |
Oops, something went wrong.