ID: 11924
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Feedback
Bug Type: InterBase related
Operating System: Windows 2000
PHP Version: 4.0.6
New Comment:
Here is full information, test database creation script included:
test.sql
========
SET SQL DIALECT 3;
SET NAMES NONE;
CREATE DATABASE 'C:\TEST.GDB'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 4096
DEFAULT CHARACTER SET NONE;
CREATE GENERATOR GEN_MY_TABLE_ID;
CREATE TABLE MY_TABLE (
ID INTEGER NOT NULL,
STR_FIELD VARCHAR(50),
INT_FIELD INTEGER);
ALTER TABLE MY_TABLE ADD CONSTRAINT PK__MY_TABLE PRIMARY KEY (ID);
SET TERM ^ ;
CREATE TRIGGER MY_TABLE_BI FOR MY_TABLE
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID IS NULL) THEN
NEW.ID = GEN_ID(GEN_MY_TABLE_ID,1);
END
^
SET TERM ; ^
test.php
========
<?php
ibase_connect('localhost:c:\test.gdb','SYSDBA','masterkey');
$args = array('some text','another text');
$query = ibase_prepare('insert into MY_TABLE (INT_FIELD, STR_FIELD)
values (?,?)');
array_unshift($args,$query);
print_r($args);
$rs = call_user_func_array('ibase_execute',$args);
print_r($args);
ibase_free_query($query);
ibase_close();
?>
Expected results:
=================
Array
(
[0] => Resource id #2
[1] => some text
[2] => another text
)
Array
(
[0] => Resource id #2
[1] => some text
[2] => another text
)
Actual results:
===============
Array
(
[0] => Resource id #2
[1] => some text
[2] => another text
)
Array
(
[0] => Resource id #2
[1] => 0
[2] => another text
)
---------------------------------------
As you can see - after calling call_user_func_array() data into
$args[1] has been changed, while it should stay the same.
Previous Comments:
------------------------------------------------------------------------
[2002-05-26 04:35:06] [EMAIL PROTECTED]
Which code example exactly? Can you show me the full script (As short
as possible).
Derick
------------------------------------------------------------------------
[2002-05-25 09:54:04] [EMAIL PROTECTED]
> I'd like to know the output of:
> var_dump (get_func_args()) in ibase_execute... this is your > own
function, isn't it?
No, it is InterBase module function :)
http://www.php.net/manual/en/function.ibase-execute.php
This bug is still present in 4.2.1, that code example returns me:
Array
(
[0] => Resource id #2
[1] => some text
[2] => amother text
)
Array
(
[0] => Resource id #2
[1] => 0
[2] => amother text
)
As you can see - contents of array with index 1 is changes, while they
should not.
------------------------------------------------------------------------
[2002-05-25 09:41:40] [EMAIL PROTECTED]
ok, nm :)
I'd like to know the output of:
var_dump (get_func_args()) in ibase_execute... this is your own
function, isn't it?
Derick
------------------------------------------------------------------------
[2002-05-25 09:27:25] [EMAIL PROTECTED]
Sorry, but i don't understand your question...
------------------------------------------------------------------------
[2002-05-25 09:21:56] [EMAIL PROTECTED]
Who would you want to do something like this?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/11924
--
Edit this bug report at http://bugs.php.net/?id=11924&edit=1