Bug on OCI, still exist in Yii 1.0.6

Continue my post at http://www.yiiframew…pic,2460.0.html about bugs on OCI Active Record.

I'm using CRUD command to generate my code. On insert new record the application throw an error like this:



Property "COciCommandBuilder._connection" is not defined.


Source File





C:Program FilesZendApache2htdocsyii106frameworkdbschemaociCOciCommandBuilder.php(108)





00096:                 {


00097:                     $placeholders[]=':'.$name;


00098:                     $values[':'.$name]=$column->typecast($value);


00099:                 }


00100:             }


00101:         }


00102: 


00103:         $sql="INSERT INTO {$table->rawName} (".implode(', ',$fields).') VALUES ('.implode(', ',$placeholders).')';


00104: 


00105:         if(is_string($table->primaryKey))


00106:         {


00107:             $sql.=" RETURNING ".$table->primaryKey." INTO :RETURN_ID";


00108: $command=$this->_connection->createCommand($sql);


00109:             $command->bindParam(':RETURN_ID', $this->returnID, PDO::PARAM_INT, 12);


00110:             $table->sequenceName='RETURN_ID';


00111:         }


00112:         else


00113:             $command=$this->_connection->createCommand($sql);


00114: 


00115:         foreach($values as $name=>$value)


00116:             $command->bindValue($name,$value);


00117: 


00118:         return $command;


00119:     }


00120: }


I'm try to analyze this error and found that $this->_connection property was declared as private property on CDbCommandBuilder class, so it's not exist on COciCommandBuilder because this class extend the CDbCommandBuilder class. As I know if we need to inherit the class properties we need to declare it as protected instead private.

Should I create a ticket for all this OCI bugs?

Thanks. Just fixed it.

Just want to share another bug I found on OCI driver. I'm using OCI ActiveRecord on my application and it's throw an error on line 230



foreach($command->queryAll() as $row)


		{


			if($row['constraint_type']==='R')   // foreign key<--here is the error


			{


				$name = $row["COLUMN_NAME"];


				$table->foreignKeys[$name]=array($row["TABLE_REF"], array($row["COLUMN_REF"]));


				if(isset($table->columns[$name]))


					$table->columns[$name]->isForeignKey=true;


			}





		}


The error was show me undefined index on array $row['constraint_type']. After I check the problem is the index typed in lowercase and all index defined in uppercase. So I change it to $row['CONSTRAINT_TYPE'] and it's work.

Thanks. It's fixed. There might be other bugs in the OCI support since I don't have Oracle to fully test it. Please let me know if you find anything else not working. Thanks.