Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL5.7.5 以降で SET SESSION storage_engine = InnoDB がエラーになるのを修正 #173

Merged
merged 1 commit into from
Oct 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'");
}
}
8 changes: 6 additions & 2 deletions html/install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'");
}

Expand Down