propelorm / sfPropelORMPlugin

symfony 1.x plugin for Propel.
http://www.propelorm.org/
Other
109 stars 95 forks source link

fix cleanupSQL in DBMSSQL.php #192

Open oms-rubus opened 11 years ago

oms-rubus commented 11 years ago

I have an exception when try to insert values in table: Unable to execute INSERT statement [INSERT INTO movie (STUDIO_ID,COUNTRY_ID,CATEGORY_ID,TITLE,TITLE_ENG,YEAR,DESCRIPTION,MPAA,LENGTH,AGE) VALUES (:p9,:p2,:p3,:p4,:p5,:p6,0xd09ed0bfd0b8d181d0b0d0bdd0b8d0b520d182d0b5d181d182d0bed0b2d0bed0b3d0be20d184d0b8d0bbd18cd0bcd0b0,:p7,:p8,:p90)] [wrapped: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined]

Fix row 298 in sfPropelORMPlugin/lib/vendor/propel/runtime/lib/adapter/DBMSSQL.php (cleanupSQL method) from: preg_match_all('/:p\d/', $sql, $matches); to: preg_match_all('/:p\d+/', $sql, $matches);

brunnels commented 11 years ago

Good catch. Is DESCRIPTION actually a blob or should it be longvarchar? The reason I ask is the binary you see in the query is a workaround for dblib's ability to save binary data properly. I'm sure it adds a bit of overhead to the queries when used so if you aren't storing binary data it would be best to use longvarchar instead.

On Wed, Apr 3, 2013 at 8:03 AM, Maxim notifications@github.com wrote:

I have an exception when try to insert values in table: Unable to execute INSERT statement [INSERT INTO movie (STUDIO_ID,COUNTRY_ID,CATEGORY_ID,TITLE,TITLE_ENG,YEAR,DESCRIPTION,MPAA,LENGTH,AGE) VALUES (:p9,:p2,:p3,:p4,:p5,:p6,0xd09ed0bfd0b8d181d0b0d0bdd0b8d0b520d182d0b5d181d182d0bed0b2d0bed0b3d0be20d184d0b8d0bbd18cd0bcd0b0,:p7,:p8,:p90)] [wrapped: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined]

Fix row 298 in sfPropelORMPlugin/lib/vendor/propel/runtime/lib/adapter/DBMSSQL.php (cleanupSQL method) from: preg_match_all('/:p\d/', $sql, $matches); to: preg_match_all('/:p\d+/', $sql, $matches);

— Reply to this email directly or view it on GitHubhttps://github.com/propelorm/sfPropelORMPlugin/issues/192 .

oms-rubus commented 11 years ago

I am trying to migrate project from mysql to mssql with minimal changes in current scheme. But I am thinking about using longvarchar for description.