Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Broken behavior for SET in SQL update #6820

Closed
sebastien-gallet opened this issue Oct 30, 2014 · 2 comments
Closed

Broken behavior for SET in SQL update #6820

sebastien-gallet opened this issue Oct 30, 2014 · 2 comments

Comments

@sebastien-gallet
Copy link
Contributor

Regression bug

use Zend\Db\Sql\Sql;
[...]
$sql = new Sql($adapter);
$update = $sql->update();

$data = array(
    'field_a' => true,
    'field_b' => false,
    'field_c' => true,
);

$update
    ->table('test_table')
    ->set($data);
echo $sql->getSqlStringForSqlObject($update) . PHP_EOL; exit;

Up to ZF 2.2.8 the following was properly working and produced the following correct query

UPDATE `test_table` SET `field_a` = '1', `field_b` = '', `field_c` = '1'

But since ZF 2.3.0 (including dev-master), the query generation is broken:

UPDATE `test_table` SET `field_a` = '1'

The list of SET arguments is reduced to anything before the first false value.

@samsonasik
Copy link
Contributor

this related with PriorityList usage, should be fixed by PR #6773

@samsonasik
Copy link
Contributor

duplicate with issue #6768 , please close this.

@Ocramius Ocramius self-assigned this Nov 20, 2014
@Ocramius Ocramius added this to the 2.3.4 milestone Nov 20, 2014
Ocramius added a commit that referenced this issue Nov 20, 2014
…'develop'

Close #6773
Close #6768
Close #6820
Close #6834
Close #6881
Forward port #6773
Forward port #6768
Ocramius added a commit that referenced this issue Nov 20, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants