Does anyone know why they added this in 2.0.33?
/vendor/yiisoft/yii2/db/oci/command
The case is that in 2.0.32 with
'components' => [
'db' => [
// 'class' => '\ sfedosimov \ oci8pdo \ Oci8PDO_Connection'
The schematics were loaded correctly, but now it doesn’t work, the reason.
protected function findColumns ($ table)
{
$ sql = <<< 'SQL'
SELECT
A.COLUMN_NAME,
A.DATA_TYPE,
A.DATA_PRECISION,
A.DATA_SCALE,
(
CASE A.CHAR_USED WHEN 'C' THEN A.CHAR_LENGTH
ELSE A.DATA_LENGTH
END
) AS DATA_LENGTH,
A. NULLABLE,
A.DATA_DEFAULT,
COM.COMMENTS AS COLUMN_COMMENT
FROM ALL_TAB_COLUMNS TO
INNER JOIN ALL_OBJECTS B ON B.OWNER = A.OWNER AND LTRIM (B.OBJECT_NAME) = LTRIM (A.TABLE_NAME)
LEFT JOIN ALL_COL_COMMENTS COM ON (A.OWNER = COM.OWNER AND A.TABLE_NAME = COM.TABLE_NAME AND A.COLUMN_NAME = COM.COLUMN_NAME)
WHERE
A.OWNER =: schemaName
AND B.OBJECT_TYPE IN ('TABLE', 'VIEW', 'MATERIALIZED VIEW')
AND B.OBJECT_NAME =: tableName
ORDER BY A.COLUMN_ID
SQL;
try {
$ columns = $ this-> db-> createCommand ($ sql, [
**': tableName' => $ table-> name,**
** ': schemaName' => $ table-> schemaName,**
]) -> queryAll ();
\ yii :: trace ("Table:". $ table-> name. "\ n schema:". $ table-> schemaName. "\ nOutput:". print_r ($ columns, true));
} catch (\ Exception $ e) {
return false;
}
if (empty ($ columns)) {
return false;
}
foreach ($ columns as $ column) {
if ($ this-> db-> slavePdo-> getAttribute (\ PDO :: ATTR_CASE) === \ PDO :: CASE_LOWER) {
$ column = array_change_key_case ($ column, CASE_UPPER);
}
$ c = $ this-> createColumn ($ column);
$ table-> columns [$ c-> name] = $ c;
}
return true;
}
It will return null, because of this new insert in 2.0.33, if you comment it … it works.
/vendor/yiisoft/yii2/db/oci/command
class Command extends \ yii \ db \ Command
{
/ **
* {@inheritdoc}
* /
protected function bindPendingParams ()
{
\ yii :: trace ('$ this-> pendingParams:'. print_r ($ this-> pendingParams, true));
foreach ($ this-> pendingParams as $ name => $ value) {
if (\ PDO :: PARAM_STR === $ value [1]) {
$ passedByRef = $ value [0];
$ this-> pdoStatement-> bindParam ($ name, $ passedByRef, $ value [1], strlen ($ value [0]));
} else {
$ this-> pdoStatement-> bindValue ($ name, $ value [0], $ value [1]);
}
}
$ this-> pendingParams = [];
}
}