<?
/* $Id$ */
- $test_base = "ibase_test.tmp";
+ // remember to:
+ // a) give write permission to the ext/ibase/tests directory
+ // to the user running interbase, otherwise db creation/deletion will fail
+ // b) set ISC_USER and ISC_PASSWORD env vars before running the tests in order
+ // to be able to connect to Interbase
+ $test_base = dirname(__FILE__)."/ibase_test.tmp";
$name = tempnam("","CREATEDB");
$ftmp = fopen($name,"w");
if (is_file($test_base))
fwrite($ftmp,
"create database \"$test_base\";
create table test1 (
- i integer,
- c varchar(100)
- );
- commit;
- insert into test1(i, c) values(1, 'test table created with isql');
- exit;\n"
+ i integer,
+ c varchar(100)
+ );
+ commit;
+ insert into test1(i, c) values(1, 'test table created with isql');
+ exit;\n"
);
fclose($ftmp);
- exec("isql -i $name 2>&1");
+ // passthru gives us some output, allowing the test to pass
+ // (actually, it passes after the first run when the db gets deleted/recreated)
+ passthru("isql -i $name 2>&1");
unlink($name);
?>
--EXPECT--
-
+Use CONNECT or CREATE DATABASE to specify a database
+Database: "ext/interbase/tests/ibase_test.tmp"
<?
/* $Id$ */
- require("interbase/interbase.inc");
+ require(dirname(__FILE__)."/interbase.inc");
- $test_base = "ibase_test.tmp";
+ $test_base = dirname(__FILE__)."/ibase_test.tmp";
ibase_connect($test_base);
out_table("test1");
<?
/* $Id$ */
- require("interbase/interbase.inc");
+ require(dirname(__FILE__)."/interbase.inc");
- $test_base = "ibase_test.tmp";
+ $test_base = dirname(__FILE__)."/ibase_test.tmp";
ibase_connect($test_base);
"create table test3 (
iter integer,
v_char char(1000),
- v_date date,
+ v_date timestamp,
v_decimal decimal(12,3),
v_double double precision,
v_float float,
$v_char = rand_str(1000);
$v_date = rand_datetime();
$v_decimal = rand_number(12,3);
- $v_double = rand_number(20);
+ $v_double = rand_number(18);
$v_float = rand_number(7);
$v_integer = rand_number(9,0);
$v_numeric = rand_number(4,2);
"insert into test3 (iter, v_char,v_date,v_decimal,v_double,v_float,v_integer,v_numeric,v_smallint,v_varchar)
values ($iter, '$v_char','$v_date',$v_decimal,$v_double,$v_float,$v_integer,$v_numeric,$v_smallint,'$v_varchar')");
$sel = ibase_query("select * from test3 where iter = $iter");
-
+ $sel = ibase_query("select * from test3 where iter = $iter");
$row = ibase_fetch_object($sel);
if(substr($row->V_CHAR,0,strlen($v_char)) != $v_char){
echo " CHAR fail:\n";
<?
/* $Id$ */
- require("interbase/interbase.inc");
+ require(dirname(__FILE__)."/interbase.inc");
- $test_base = "ibase_test.tmp";
+ $test_base = dirname(__FILE__)."/ibase_test.tmp";
ibase_connect($test_base);
<?
/* $Id$ */
- require("interbase/interbase.inc");
+ require(dirname(__FILE__)."/interbase.inc");
- $test_base = "ibase_test.tmp";
+ $test_base = dirname(__FILE__)."/ibase_test.tmp";
ibase_connect($test_base);
$tr_1 = ibase_trans(); /* this default transaction also */
$tr_2 = ibase_trans(IBASE_READ);
- $tr_3 = ibase_trans(IBASE_READ+IBASE_COMMITED);
+ $tr_3 = ibase_trans(IBASE_READ+IBASE_COMMITTED);
$res = ibase_query("select * from test5");
ibase_free_result($res);
ibase_close();
-
/*
transactions on second link
*/
$link_1 = ibase_pconnect($test_base);
$link_2 = ibase_pconnect($test_base);
- $tr_1 = ibase_trans($link_2, IBASE_DEFAULT); /* this default transaction also */
- $tr_2 = ibase_trans($link_2, IBASE_COMMITED);
+ $tr_1 = ibase_trans(IBASE_DEFAULT, $link_2); /* this default transaction also */
+ $tr_2 = ibase_trans(IBASE_COMMITTED, $link_2);
$res = ibase_query($tr_1, "select * from test5");
<?
/* $Id$ */
- require("interbase/interbase.inc");
+ require(dirname(__FILE__)."/interbase.inc");
- $test_base = "ibase_test.tmp";
+ $test_base = dirname(__FILE__)."/ibase_test.tmp";
ibase_connect($test_base);
"create table test6 (
iter integer,
v_char char(1000),
- v_date date,
+ v_date timestamp,
v_decimal decimal(12,3),
v_double double precision,
v_float float,