Bug #4972
array PHP <-> Pg conversion is broken
Status:
In Progress
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Description
Element parsing in arrays can easily be confused. Test case:
create or replace function another_text_test(text[], int) returns text language plphp as $$ return $argsr0[$argsr1]; $$;
Strings should be quoted before passing them to PHP, so the NOTICE from PHP here is bogus:
pl_regression=# select another_text_test($${"foo",'bar', "{"}$$, 0); NOTICE: plphp: Use of undefined constant foo - assumed 'foo' another_text_test ------------------- foo (1 fila)
The same reason causes this to "eat" the inner level of quotes:
pl_regression=# select another_text_test($${"'bar'", "{"}$$, 0); another_text_test ------------------- bar (1 fila)
Note particularly this totally unexpected behavior:
pl_regression=# select another_text_test($${"'bar'", "{"}$$, 1); another_text_test ------------------- array( (1 fila)