Skip Menu |

This queue is for tickets about the Fey CPAN distribution.

Report information
The Basics
Id: 48676
Status: resolved
Priority: 0/
Queue: Fey

People
Owner: Nobody in particular
Requestors: bitcard-cpan [...] wilz.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.22
Fixed in: 0.23



Subject: Fey::SQL::Insert->values method mixing up order ?
Hello, I'm using something similar to the following code to explicitely add columns to an insert statement, as some of the columns uses database functions as default value. (The actual code is a little bit more complex, but the values are verified by printf debugging): --- snip --- my $child_data = { 'parent' => '4', 'child_count' => 2, 'child_index' => 2, 'child' => '3' }; my @relation_keys = qw(child_count child_index child parent); my $relations_table = $schema->table($self->relation_table); my $sql = Fey::SQL->new_insert(); $sql->insert->into(map {$relations_table->column($_)} @relation_keys); $sql->values(%$child_data); my @bind = $sql->bind_params; print Dumper $sql->sql($db); print Dumper $child_data; print Dumper \@bind; --- snip --- Which outputs this $VAR1 = 'INSERT INTO "node_relations" ("child_count", "child_index", "child", "parent") VALUES (?, ?, ?, ?)'; $VAR1 = { 'parent' => '4', 'child_count' => 2, 'child_index' => 1, 'child' => '2' }; $VAR1 = [ '4', 2, 1, '2' ]; Neglecting Integer/String type issues in my code I was expecting Fey to return the bind_params as given by the order of the columns used with the into method. Is this expectation flawed and should I use another mechanism for inserting a subset of columns ? Thanks, Martin
This was fixed a long time ago (in 0.23). If you're still seeing it, please make a test that demonstrates the issue with the latest release (0.31). If not, please don't reply, or else this ticket will be re-opened. Thanks, -dave