From 16fb072d909b96253241dd24d25c12e1b95ecaed Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Sun, 15 Oct 2017 00:14:19 +0900 Subject: [PATCH] =?UTF-8?q?MySQL5.7.5=20=E4=BB=A5=E9=99=8D=E3=81=A7=20`SET?= =?UTF-8?q?=20SESSION=20storage=5Fengine=20=3D=20InnoDB`=20=E3=81=8C?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php | 6 +++++- html/install/index.php | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php b/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php index 1616e4bdea..db2cdaa7d4 100644 --- a/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php +++ b/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php @@ -360,7 +360,11 @@ public function getDummyFromClauseSql() */ public function initObjQuery(SC_Query &$objQuery) { - $objQuery->exec('SET SESSION storage_engine = InnoDB'); + if ($objQuery->conn->getConnection()->server_version >= 50705) { + $objQuery->exec('SET SESSION default_storage_engine = InnoDB'); + } else { + $objQuery->exec('SET SESSION storage_engine = InnoDB'); + } $objQuery->exec("SET SESSION sql_mode = 'ANSI'"); } } diff --git a/html/install/index.php b/html/install/index.php index 317e1a7e4f..22f7b45ebd 100644 --- a/html/install/index.php +++ b/html/install/index.php @@ -850,8 +850,12 @@ function lfExecuteSQL($filepath, $arrDsn, $disp_err = true) // MySQL 用の初期化 // XXX SC_Query を使うようにすれば、この処理は不要となる - if ($arrDsn['phptype'] === 'mysql') { - $objDB->exec('SET SESSION storage_engine = InnoDB'); + if ($arrDsn['phptype'] === 'mysqli') { + if ($objDB->getConnection()->server_version >= 50705) { + $objDB->exec('SET SESSION defaut_storage_engine = InnoDB'); + } else { + $objDB->exec('SET SESSION storage_engine = InnoDB'); + } $objDB->exec("SET SESSION sql_mode = 'ANSI'"); }