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

Try to fix PHP/hhvm tests by working around an issue with SET NAMES #3220

Merged
merged 1 commit into from
Jan 30, 2018
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
14 changes: 6 additions & 8 deletions frameworks/PHP/hhvm/once.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
class Benchmark {
var $pdo;

public function setup_db($need_utf8 = true)
public function setup_db()
{
$attrs = array(PDO::ATTR_PERSISTENT => false);
// hhvm doesn't support charset=utf8 in the DSN yet
// See https://github.com/facebook/hhvm/issues/1309
if ($need_utf8) {
$attrs[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES utf8";
}
$this->pdo = new PDO('mysql:host=localhost;dbname=hello_world', 'benchmarkdbuser', 'benchmarkdbpass', $attrs);
$this->pdo = new PDO(
'mysql:host=TFB-database;dbname=hello_world;charset=utf8',
'benchmarkdbuser',
'benchmarkdbpass',
array(PDO::ATTR_PERSISTENT => false));
}

public function bench_json()
Expand Down
1 change: 0 additions & 1 deletion frameworks/PHP/hhvm/setup_hhvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

fw_depends mysql nginx php7 hhvm

sed -i 's|host=localhost;|host='"${DBHOST}"';|g' once.php.inc
sed -i 's|SourceRoot = .*/FrameworkBenchmarks/hhvm|SourceRoot = '"${TROOT}"'|g' deploy/config.hdf
sed -i 's|Path = .*/.hhvm.hhbc|Path = '"${TROOT}"'/.hhvm.bbhc|g' deploy/config.hdf
sed -i 's|PidFile = .*/hhvm.pid|PidFile = '"${TROOT}"'/hhvm.pid|g' deploy/config.hdf
Expand Down