From fc4ed7183970ebe7f5e57dc200836365e68c1a72 Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Wed, 26 Jun 2013 11:47:42 -0700 Subject: [PATCH] Fix PDO MySQL bug in getColumnMeta() In trying to get the CakePHP Blog Tutorial to run on HHVM, a subtle bug was found where the table name was not being returned, and, instead, an numeric index was being used. The bug was in PDOMySqlStatement::getColumnMeta (pdo_mysql.cpp). Applying this fix, the flock/fwrite fix (D855470) and the Reflection::SetAccessible (D851647) fix makes the CakePHP tutorial run like a champ. --- hphp/runtime/ext/pdo_mysql.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hphp/runtime/ext/pdo_mysql.cpp b/hphp/runtime/ext/pdo_mysql.cpp index e092f434e..fd6c9042f 100644 --- a/hphp/runtime/ext/pdo_mysql.cpp +++ b/hphp/runtime/ext/pdo_mysql.cpp @@ -1157,7 +1157,7 @@ static const StaticString s_native_type("native_type"); static const StaticString s_flags("flags"); static const StaticString s_table("table"); -bool PDOMySqlStatement::getColumnMeta(int64_t colno, Array &return_value) { +bool PDOMySqlStatement::getColumnMeta(int64_t colno, Array &ret) { if (!m_result) { return false; } @@ -1166,7 +1166,6 @@ bool PDOMySqlStatement::getColumnMeta(int64_t colno, Array &return_value) { return false; } - Array ret = Array::Create(); Array flags = Array::Create(); const MYSQL_FIELD *F = m_fields + colno;