From f3410d8f6c0b7618760c5ac605e7182aae06f135 Mon Sep 17 00:00:00 2001 From: "Revamp Software, Inc." Date: Wed, 25 Apr 2018 17:52:41 +0800 Subject: [PATCH 1/2] use offset only when limit is available Signed-off-by: Revamp Software, Inc. --- src/Illuminate/Database/Query/Grammars/Grammar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Query/Grammars/Grammar.php b/src/Illuminate/Database/Query/Grammars/Grammar.php index b3742b0f6ad2..4eff5c6d8e7a 100755 --- a/src/Illuminate/Database/Query/Grammars/Grammar.php +++ b/src/Illuminate/Database/Query/Grammars/Grammar.php @@ -612,7 +612,7 @@ protected function compileLimit(Builder $query, $limit) */ protected function compileOffset(Builder $query, $offset) { - return 'offset '.(int) $offset; + return $query->limit ? 'offset '.(int) $offset : ''; } /** From cab0db240509c25a9ec507f618bb408cb1bd0868 Mon Sep 17 00:00:00 2001 From: "Revamp Software, Inc." Date: Wed, 25 Apr 2018 18:51:05 +0800 Subject: [PATCH 2/2] NO_AUTO_CREATE_USER SQL mode is removed from MySQL 8.0. Signed-off-by: Revamp Software, Inc. --- src/Illuminate/Database/Connectors/MySqlConnector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index 3b12b300ef75..595a84cd9498 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -175,6 +175,6 @@ protected function setCustomModes(PDO $connection, array $config) */ protected function strictMode() { - return "set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"; + return "set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'"; } }