Project

General

Profile

Feature #19807 » 10116_trunk.diff

Administrator Admin, 2009-01-13 10:12

View differences:

typo3/sysext/adodb/adodb/tests/benchmark.php (working copy)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>ADODB Benchmarks</title>
</head>
<body>
<?php
/*
V4.81 3 May 2006 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Benchmark code to test the speed to the ADODB library with different databases.
This is a simplistic benchmark to be used as the basis for further testing.
It should not be used as proof of the superiority of one database over the other.
*/
$testmssql = true;
//$testvfp = true;
$testoracle = true;
$testado = true;
$testibase = true;
$testaccess = true;
$testmysql = true;
$testsqlite = true;;
set_time_limit(240); // increase timeout
include("../tohtml.inc.php");
include("../adodb.inc.php");
function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
{
GLOBAL $ADODB_version,$ADODB_FETCH_MODE;
adodb_backtrace();
$max = 100;
$sql = 'select * from ADOXYZ';
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
//print "<h3>ADODB Version: $ADODB_version Host: <i>$db->host</i> &nbsp; Database: <i>$db->database</i></h3>";
// perform query once to cache results so we are only testing throughput
$rs = $db->Execute($sql);
if (!$rs){
print "Error in recordset<p>";
return;
}
$arr = $rs->GetArray();
//$db->debug = true;
global $ADODB_COUNTRECS;
$ADODB_COUNTRECS = false;
$start = microtime();
for ($i=0; $i < $max; $i++) {
$rs =& $db->Execute($sql);
$arr =& $rs->GetArray();
// print $arr[0][1];
}
$end = microtime();
$start = explode(' ',$start);
$end = explode(' ',$end);
//print_r($start);
//print_r($end);
// print_r($arr);
$total = $end[0]+trim($end[1]) - $start[0]-trim($start[1]);
printf ("<p>seconds = %8.2f for %d iterations each with %d records</p>",$total,$max, sizeof($arr));
flush();
//$db->Close();
}
include("testdatabases.inc.php");
?>
</body>
</html>
typo3/sysext/adodb/adodb/tests/client.php (working copy)
<html>
<body bgcolor=white>
<?php
/**
* V4.50 6 July 2004 (c) 2001-2002 John Lim (jlim#natsoft.com.my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
*
* set tabs to 8
*/
// documentation on usage is at http://php.weblogs.com/adodb_csv
echo PHP_VERSION,'<br>';
var_dump(parse_url('odbc_mssql://userserver/'));
die();
include('../adodb.inc.php');
include('../tohtml.inc.php');
function &send2server($url,$sql)
{
$url .= '?sql='.urlencode($sql);
print "<p>$url</p>";
$rs = csv2rs($url,$err);
if ($err) print $err;
return $rs;
}
function print_pre($s)
{
print "<pre>";print_r($s);print "</pre>";
}
$serverURL = 'http://localhost/php/phplens/adodb/server.php';
$testhttp = false;
$sql1 = "insertz into products (productname) values ('testprod 1')";
$sql2 = "insert into products (productname) values ('testprod 1')";
$sql3 = "insert into products (productname) values ('testprod 2')";
$sql4 = "delete from products where productid>80";
$sql5 = 'select * from products';
if ($testhttp) {
print "<a href=#c>Client Driver Tests</a><p>";
print "<h3>Test Error</h3>";
$rs = send2server($serverURL,$sql1);
print_pre($rs);
print "<hr />";
print "<h3>Test Insert</h3>";
$rs = send2server($serverURL,$sql2);
print_pre($rs);
print "<hr />";
print "<h3>Test Insert2</h3>";
$rs = send2server($serverURL,$sql3);
print_pre($rs);
print "<hr />";
print "<h3>Test Delete</h3>";
$rs = send2server($serverURL,$sql4);
print_pre($rs);
print "<hr />";
print "<h3>Test Select</h3>";
$rs = send2server($serverURL,$sql5);
if ($rs) rs2html($rs);
print "<hr />";
}
print "<a name=c><h1>CLIENT Driver Tests</h1>";
$conn = ADONewConnection('csv');
$conn->Connect($serverURL);
$conn->debug = true;
print "<h3>Bad SQL</h3>";
$rs = $conn->Execute($sql1);
print "<h3>Insert SQL 1</h3>";
$rs = $conn->Execute($sql2);
print "<h3>Insert SQL 2</h3>";
$rs = $conn->Execute($sql3);
print "<h3>Select SQL</h3>";
$rs = $conn->Execute($sql5);
if ($rs) rs2html($rs);
print "<h3>Delete SQL</h3>";
$rs = $conn->Execute($sql4);
print "<h3>Select SQL</h3>";
$rs = $conn->Execute($sql5);
if ($rs) rs2html($rs);
/* EXPECTED RESULTS FOR HTTP TEST:
Test Insert
http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
adorecordset Object
(
[dataProvider] => native
[fields] =>
[blobSize] => 64
[canSeek] =>
[EOF] => 1
[emptyTimeStamp] =>
[emptyDate] =>
[debug] =>
[timeToLive] => 0
[bind] =>
[_numOfRows] => -1
[_numOfFields] => 0
[_queryID] => 1
[_currentRow] => -1
[_closed] =>
[_inited] =>
[sql] => insert into products (productname) values ('testprod')
[affectedrows] => 1
[insertid] => 81
)
--------------------------------------------------------------------------------
Test Insert2
http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
adorecordset Object
(
[dataProvider] => native
[fields] =>
[blobSize] => 64
[canSeek] =>
[EOF] => 1
[emptyTimeStamp] =>
[emptyDate] =>
[debug] =>
[timeToLive] => 0
[bind] =>
[_numOfRows] => -1
[_numOfFields] => 0
[_queryID] => 1
[_currentRow] => -1
[_closed] =>
[_inited] =>
[sql] => insert into products (productname) values ('testprod')
[affectedrows] => 1
[insertid] => 82
)
--------------------------------------------------------------------------------
Test Delete
http://localhost/php/adodb/server.php?sql=delete+from+products+where+productid%3E80
adorecordset Object
(
[dataProvider] => native
[fields] =>
[blobSize] => 64
[canSeek] =>
[EOF] => 1
[emptyTimeStamp] =>
[emptyDate] =>
[debug] =>
[timeToLive] => 0
[bind] =>
[_numOfRows] => -1
[_numOfFields] => 0
[_queryID] => 1
[_currentRow] => -1
[_closed] =>
[_inited] =>
[sql] => delete from products where productid>80
[affectedrows] => 2
[insertid] => 0
)
[more stuff deleted]
.
.
.
*/
?>
typo3/sysext/adodb/adodb/tests/pdo.php (working copy)
<?php
error_reporting(E_ALL);
include('../adodb.inc.php');
echo "<pre>";
try {
echo "New Connection\n";
$dsn = 'pdo_mysql://root:@localhost/northwind?persist';
if (!empty($dsn)) {
$DB =& NewADOConnection($dsn) || die("CONNECT FAILED");
$connstr = $dsn;
} else {
$DB = NewADOConnection('pdo');
echo "Connect\n";
$u = ''; $p = '';
/*
$connstr = 'odbc:nwind';
$connstr = 'oci:';
$u = 'scott';
$p = 'natsoft';
$connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
*/
$connstr = "mysql:dbname=northwind";
$u = 'root';
$connstr = "pgsql:dbname=test";
$u = 'tester';
$p = 'test';
$DB->Connect($connstr,$u,$p) || die("CONNECT FAILED");
}
echo "connection string=$connstr\n Execute\n";
//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$rs = $DB->Execute("select * from ADOXYZ where id<3");
if ($DB->ErrorNo()) echo "*** errno=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
//print_r(get_class_methods($DB->_stmt));
if (!$rs) die("NO RS");
echo "Meta\n";
for ($i=0; $i < $rs->NumCols(); $i++) {
var_dump($rs->FetchField($i));
echo "<br>";
}
echo "FETCH\n";
$cnt = 0;
while (!$rs->EOF) {
adodb_pr($rs->fields);
$rs->MoveNext();
if ($cnt++ > 1000) break;
}
echo "<br>--------------------------------------------------------<br>\n\n\n";
$stmt = $DB->PrepareStmt("select * from ADOXYZ");
$rs = $stmt->Execute();
$cols = $stmt->NumCols(); // execute required
echo "COLS = $cols";
for($i=1;$i<=$cols;$i++) {
$v = $stmt->_stmt->getColumnMeta($i);
var_dump($v);
}
echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
while ($arr = $rs->FetchRow()) {
adodb_pr($arr);
}
die("DONE\n");
} catch (exception $e) {
echo "<pre>";
echo $e;
echo "</pre>";
}
?>
typo3/sysext/adodb/adodb/tests/rr.htm (working copy)
Content-type: text/html
X-Powered-By: PHP/4.3.8
<html>
<title>ADODB Testing</title>
<body bgcolor=white>
<H1>ADODB Test</H1>
This script tests the following databases: Interbase, Oracle, Visual FoxPro, Microsoft Access (ODBC and ADO), MySQL, MSSQL (ODBC, native, ADO).
There is also support for Sybase, PostgreSQL.</p>
For the latest version of ADODB, visit <a href=http://adodb.sourceforge.net/>adodb.sourceforge.net</a>.</p>
Test <a href=test4.php>GetInsertSQL/GetUpdateSQL</a> &nbsp;
<a href=testsessions.php>Sessions</a> &nbsp;
<a href=testpaging.php>Paging</a> &nbsp;
<a href=test-perf.php>Perf Monitor</a><p>
<table><tr valign=top><td>
<form method=get>
<input type=checkbox name="testaccess" value=1 > <b>Access</b><br>
<input type=checkbox name="testibase" value=1 > <b>Interbase</b><br>
<input type=checkbox name="testmssql" value=1 > <b>MSSQL</b><br>
<input type=checkbox name="testmysql" value=1 > <b>MySQL</b><br>
<input type=checkbox name="testmysqlodbc" value=1 > <b>MySQL ODBC</b><br>
<input type=checkbox name="testmysqli" value=1 > <b>MySQLi</b>
<br>
<td><input type=checkbox name="testsqlite" value=1 > <b>SQLite</b><br>
<input type=checkbox name="testproxy" value=1 > <b>MySQL Proxy</b><br>
<input type=checkbox name="testoracle" value=1 checked> <b>Oracle (oci8)</b> <br>
<input type=checkbox name="testpostgres" value=1 > <b>PostgreSQL</b><br>
<input type=checkbox name="testpgodbc" value=1 > <b>PostgreSQL ODBC</b><br>
<td>
<input type=checkbox name="testpdopgsql" value=1 > <b>PgSQL PDO</b><br>
<input type=checkbox name="testpdomysql" value=1 > <b>MySQL PDO</b><br>
<input type=checkbox name="testpdosqlite" value=1 > <b>SQLite PDO</b><br>
<input type=checkbox name="testpdoaccess" value=1 > <b>Access PDO</b><br>
<td><input type=checkbox name="testdb2" value=1 > DB2<br>
<input type=checkbox name="testvfp" value=1 > VFP+ODBTP<br>
<input type=checkbox name="testado" value=1 > ADO (for mssql and access)<br>
<input type=checkbox name="nocountrecs" value=1 > $ADODB_COUNTRECS=false<br>
<input type=checkbox name="nolog" value=1 > No SQL Logging<br>
<input type=checkbox name="time" value=1 > ADOdb time test
</table>
<input type=submit>
</form>
<h1>Connecting oci8po...</h1> <form method=GET>
</p>
<table width=100% ><tr><td bgcolor=beige>&nbsp;</td></tr></table>
</p>
<h3>SQL Logging enabled</h3><h3>ADODB Version: V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL. Host: <i>sherkhan</i> &nbsp; Database: <i></i> &nbsp; PHP: 4.3.8 </h3>Array
(
[compat] => 9.2.0.0.0
[description] => Oracle9i Release 9.2.0.1.0 - Production
JServer Release 9.2.0.1.0 - Production
[version] => 9.2.0.1.0
)
<br><br>db->Time: 19-05-2005 11:44:42<br>Date=2002-04-07<br><i>date1</i> (1969-02-20) = TO_DATE('1969-02-20','YYYY-MM-DD')<br><i>date1</i> (1999-02-20) = TO_DATE('1999-02-20','YYYY-MM-DD')<br><i>date1.1</i> 1999 = TO_DATE('2005-05-19','YYYY-MM-DD')<br><i>date2</i> (1970-1-2) = TO_DATE('1970-01-02','YYYY-MM-DD')<p><i>ts1</i> (1999-02-20 13:40:50) = TO_DATE('1999-02-20, 01:40:50 AM','RRRR-MM-DD, HH:MI:SS AM')<br><i>ts1.1</i> (1999-02-20 13:40:00) = TO_DATE('1999-02-20, 01:04:00 PM','RRRR-MM-DD, HH:MI:SS AM')<br><i>ts2</i> (1999-02-20) = TO_DATE('1999-02-20, 12:00:00 AM','RRRR-MM-DD, HH:MI:SS AM')<br><i>ts3</i> (1970-1-2 +/- timezone) = TO_DATE('1970-01-02, 08:00:00 AM','RRRR-MM-DD, HH:MI:SS AM')<br> Fractional TS (1999-2-20 13:40:50.91): TO_DATE('1999-02-20, 01:40:50 PM','RRRR-MM-DD, HH:MI:SS AM')<br>unixdate</i> 1999-02-20 = 1999-02-20<p><br><i>ts4</i> =61<br><i>ts5</i> =TO_DATE('2004-01-10, 09:21:23 AM','RRRR-MM-DD, HH:MI:SS AM')<br><i>ts6</i> =2004-01-10 09:21:23<br><i>ts7</i> =TO_DATE('2004-01-10, 09:21:23 AM','RRRR-MM-DD, HH:MI:SS AM')<p>Test select on empty table, FetchField when EOF, and GetInsertSQL</p><p>Testing Commit: OK</p><p>Testing Rollback: OK</p><p>Testing MetaDatabases()</p>AAArray
(
[0] => ANONYMOUS
[1] => CTXSYS
[2] => DEV
[3] => HR
[4] => IOU
[5] => JURIS10
[6] => JURIS9
[7] => MDSYS
[8] => ODB
[9] => ODB2
[10] => ODM
[11] => ODM_MTR
[12] => OE
[13] => OLAPSYS
[14] => ORDPLUGINS
[15] => ORDSYS
[16] => PM
[17] => QS
[18] => QS_ADM
[19] => QS_CB
[20] => QS_CBADM
[21] => QS_CS
[22] => QS_ES
[23] => QS_OS
[24] => QS_WS
[25] => RMAN
[26] => SCOTT
[27] => SH
[28] => SONY
[29] => TOAD
[30] => WKPROXY
[31] => WKSYS
[32] => WMSYS
[33] => XDB
)
<p>Testing MetaTables() and MetaColumns()</p>AAArray of tables and views: (abalone2) (abalone2_tree_jl1) (abalone_tree) (address) (adodb_logsql) (adoxyz) (alertrx) (atest) (billdet) (billhdr) (binlist) (cache_jorg_121) (cache_jorg_127) (contact) (create$java$lob$table) (diary) (diary2) (dlagent) (dlagentactivity) (dlagentcampaign) (dlagentcampaignvw) (dlagentcurrentstatus) (dlagenthistory) (dlagentshift) (dlagentstats) (dlagent_collection) (dlcallhistory) (dlcampaign) (dlcampaignactivity) (dlcampaignset) (dlcampaignshift) (dlcampaign_collection) (dlkbagentstatus) (dlkbarea) (dlkbgroup) (dlkbliststatus) (dlkbmedia) (dlkboutcome) (dlkbshift) (dlkbskill) (dlkbstagevw) (dlkbstatus) (dlkbtype) (dlkbvw) (dllist) (dllisterror) (dllistsource) (dllisttemp) (dlmessage) (dlteam) (dltimedcampaignactivity) (dltrafficreport) (employee) (emp_pay_hist) (emp_perf_hist) (emp_perf_plan) (endorser) (exchange) (fclsdatextra) (fclsfacreln) (fclskb) (fclskbcatvals) (fclskbexpiry) (fclskbfacreln) (fclskbprop) (fclskbstage) (fclskbstep) (fclskbstgroup) (fclssec) (fclssecrole) (fclsstepdate) (germall) (germall_cluster) (germall_range) (germall_rules) (germall_tree) (glass) (glass_tree) (ivr) (ivrcall) (ivrcca) (ivrevents) (ivrservice) (ivr_by_hour) (ivr_by_hours) (ivr_cat) (ivr_defaults) (ivr_demo) (ivr_dim) (ivr_map) (ivr_map_hours) (ivr_rp) (ivr_tmp_demo) (java$class$md5$table) (java$options) (jcampaign) (jcasemast) (jclnt) (jclntbrch) (jclntdept) (jclntdiv) (jcontact) (jcustomer) (jdefaults) (jdiary) (jfacility) (jfirm) (jfirmbrch) (jfirmdiv) (jmail) (jmail_x) (job_market_data) (jopportunity) (jorg) (jstate) (jstepprint) (jsurvey) (jtask) (jtaskitem) (kb) (kbactivity) (kbarea) (kbcatvals) (kbcountry) (kbcurrency) (kbdomain_juris10) (kbdomain_tiger2) (kbjob) (kbjobrating) (kblang) (kbmedia) (kbproductivity) (kbq) (kbqset) (kbqstatus) (kbregion) (kbrole) (kbskill) (kbstage) (kbstatus) (kbstep) (kbsteptype) (kbsubdomain) (kbworkarea) (kbworknode) (kutu_testtable) (lens_columns) (lens_groups) (lens_log) (lens_logurl) (lens_perms) (lens_rank) (lens_users) (lens_users_collection) (lens_users_x) (mcc) (myarn) (mycard) (oldkbstage) (oldkbstep) (old_ivr_by_hour) (pay_budget_hist) (pay_budget_plan) (photos) (phplens) (phplens_lock) (plan_table) (products) (qhist) (qlog) (qsetreport) (qtest) (qtest_len) (q_1005) (q_1006) (q_1008) (q_1010) (q_1011) (q_1016) (q_1017) (q_1018) (q_1019) (q_1020) (q_1021) (q_1022) (q_1023) (q_1024) (reseller) (review_period) (role) (ruledet) (splist) (tempname) (tennis) (tennis_tree) (toad_plan_table) (transact) (transact_040321) (transalert) (transalert_22) (transrule) (vt) (vwaddress) (vwcasecontact) (vwcaserolefacreln) (vwdiary_diary2) (vwfclsfacreln_contact) (vwfclssec_fclssecrole) (vwreview_search) (vwstepdatextra) (vwtransact) (vwtransalert) (xaddress) (xcase) (xcasevvv) (xcontact) (xcurstep) (xdiary) (xfirm) (xmonitor) (xrole) (xsummstatustmp) (xx) </p>AAArray of views: (address) (contact) (dlagentcampaignvw) (dlkbstagevw) (dlkbvw) (ivr) (ivr_by_hours) (ivr_map_hours) (products) (role) (vt) (vwaddress) (vwcasecontact) (vwcaserolefacreln) (vwdiary_diary2) (vwfclsfacreln_contact) (vwfclssec_fclssecrole) (vwreview_search) (vwstepdatextra) (vwtransact) (vwtransalert) (xcasevvv) (xdiary) (xfirm) </p>AAArray of ado%: (adoxyz) </p>AAArray of tables: (abalone2) (abalone2_tree_jl1) (abalone_tree) (adodb_logsql) (adoxyz) (alertrx) (atest) (billdet) (billhdr) (binlist) (cache_jorg_121) (cache_jorg_127) (create$java$lob$table) (diary) (diary2) (dlagent) (dlagentactivity) (dlagentcampaign) (dlagentcurrentstatus) (dlagenthistory) (dlagentshift) (dlagentstats) (dlagent_collection) (dlcallhistory) (dlcampaign) (dlcampaignactivity) (dlcampaignset) (dlcampaignshift) (dlcampaign_collection) (dlkbagentstatus) (dlkbarea) (dlkbgroup) (dlkbliststatus) (dlkbmedia) (dlkboutcome) (dlkbshift) (dlkbskill) (dlkbstatus) (dlkbtype) (dllist) (dllisterror) (dllistsource) (dllisttemp) (dlmessage) (dlteam) (dltimedcampaignactivity) (dltrafficreport) (employee) (emp_pay_hist) (emp_perf_hist) (emp_perf_plan) (endorser) (exchange) (fclsdatextra) (fclsfacreln) (fclskb) (fclskbcatvals) (fclskbexpiry) (fclskbfacreln) (fclskbprop) (fclskbstage) (fclskbstep) (fclskbstgroup) (fclssec) (fclssecrole) (fclsstepdate) (germall) (germall_cluster) (germall_range) (germall_rules) (germall_tree) (glass) (glass_tree) (ivrcall) (ivrcca) (ivrevents) (ivrservice) (ivr_by_hour) (ivr_cat) (ivr_defaults) (ivr_demo) (ivr_dim) (ivr_map) (ivr_rp) (ivr_tmp_demo) (java$class$md5$table) (java$options) (jcampaign) (jcasemast) (jclnt) (jclntbrch) (jclntdept) (jclntdiv) (jcontact) (jcustomer) (jdefaults) (jdiary) (jfacility) (jfirm) (jfirmbrch) (jfirmdiv) (jmail) (jmail_x) (job_market_data) (jopportunity) (jorg) (jstate) (jstepprint) (jsurvey) (jtask) (jtaskitem) (kb) (kbactivity) (kbarea) (kbcatvals) (kbcountry) (kbcurrency) (kbdomain_juris10) (kbdomain_tiger2) (kbjob) (kbjobrating) (kblang) (kbmedia) (kbproductivity) (kbq) (kbqset) (kbqstatus) (kbregion) (kbrole) (kbskill) (kbstage) (kbstatus) (kbstep) (kbsteptype) (kbsubdomain) (kbworkarea) (kbworknode) (kutu_testtable) (lens_columns) (lens_groups) (lens_log) (lens_logurl) (lens_perms) (lens_rank) (lens_users) (lens_users_collection) (lens_users_x) (mcc) (myarn) (mycard) (oldkbstage) (oldkbstep) (old_ivr_by_hour) (pay_budget_hist) (pay_budget_plan) (photos) (phplens) (phplens_lock) (plan_table) (qhist) (qlog) (qsetreport) (qtest) (qtest_len) (q_1005) (q_1006) (q_1008) (q_1010) (q_1011) (q_1016) (q_1017) (q_1018) (q_1019) (q_1020) (q_1021) (q_1022) (q_1023) (q_1024) (reseller) (review_period) (ruledet) (splist) (tempname) (tennis) (tennis_tree) (toad_plan_table) (transact) (transact_040321) (transalert) (transalert_22) (transrule) (xaddress) (xcase) (xcontact) (xcurstep) (xmonitor) (xrole) (xsummstatustmp) (xx) </p>-----
(oci8po): select lower(cname), coltype, width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='ADOXYZ' order by colno
-----
AA<p>Columns of ADOXYZ: <font size=1><br>adofieldobject Object
(
[name] => firstname
[max_length] => 24
[type] => VARCHAR2
[scale] =>
[not_null] =>
[binary] =>
[default_value] =>
)
<br>adofieldobject Object
(
[name] => lastname
[max_length] => 24
[type] => VARCHAR2
[scale] =>
[not_null] =>
[binary] =>
[default_value] =>
)
<br>adofieldobject Object
(
[name] => created
[max_length] => 7
[type] => DATE
[scale] =>
[not_null] =>
[binary] =>
[default_value] =>
)
<br></font><p>Testing MetaIndexes</p>-----
(oci8po): SELECT * FROM ALL_CONSTRAINTS WHERE UPPER(TABLE_NAME)='ADOXYZ' AND CONSTRAINT_TYPE='P'
-----
AA<b>MetaIndexes not supported</b></p><p>Testing MetaPrimaryKeys</p>-----
(oci8po):
SELECT /*+ RULE */ distinct b.column_name
FROM USER_CONSTRAINTS a
, USER_CONS_COLUMNS b
WHERE ( UPPER(b.table_name) = ('ADOXYZ'))
AND (UPPER(a.table_name) = ('ADOXYZ') and a.constraint_type = 'P')
AND (a.constraint_name = b.constraint_name)
-----
bool(false)
-----
(oci8po): delete from ADOXYZ
-----
InParameter($stmt, $php_var='99', $name='id', $maxLen=4000, $type=false);
Bind: name = id
InParameter($stmt, $php_var='123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890', $name='xx', $maxLen=-1, $type=113);
Bind: name = xx
Bind: descriptor has been allocated, var (xx) binded
Bind: LOB has been written to temp
-----
(oci8po): INSERT INTO photos ( ID, photo) VALUES ( :id, empty_blob() ) RETURNING photo INTO :xx
-----
IN LOB: LOB has been saved.
Smart Commit occurred
-----
(oci8po): select photo from photos where id=99
-----
<br>---123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890<h4>Testing Blob: size=5010</h4>-----
(oci8po): UPDATE photos set photo=EMPTY_BLOB() WHERE id=1 RETURNING photo INTO ?
-----
name=:blob var=Object len=-1 type=113<br>-----
(oci8po): select photo from photos where id=1
-----
<h4>Testing Clob: size=5010</h4>-----
(oci8po): UPDATE photos set descclob=EMPTY_CLOB() WHERE id=1 RETURNING descclob INTO ?
-----
name=:blob var=Object len=-1 type=112<br>-----
(oci8po): select descclob from photos where id=1
-----
<h4>Testing Foreign Keys</h4>-----
(oci8po): select constraint_name, r_owner, r_constraint_name
from user_constraints
where constraint_type = 'R' and table_name = 'EMP' and owner='JURIS10'
-----
AA<b>Bad MetaForeignKeys</b><br><h4>Testing Cursor Variables</h4>InParameter($stmt, $php_var='', $name='zz', $maxLen=-1, $type=116);
-----
(oci8po): BEGIN adodb.open_tab(:zz, 'A%'); END;
-----
-----
(oci8po): SELECT count(*) FROM tab where tname like 'A%'
-----
Test 1 RowCount: OK<p><h4>Testing Stored Procedures for oci8</h4>InParameter($stmt, $php_var='Malaysia', $name='a1', $maxLen=4000, $type=false);
Bind: name = a1
OutParameter($stmt, $php_var='', $name='a2', $maxLen=4000, $type=false);
Bind: name = a2
-----
(oci8po): BEGIN adodb.data_out(:a1, :a2); END;
-----
OK: a2=Cinta Hati Malaysia<p>InParameter($stmt, $php_var='A%', $name='tablename', $maxLen=4000, $type=false);
Bind: name = tablename
-----
(oci8po): select * from tab where tname like :tablename
-----
<TABLE COLS=3 BORDER='1' WIDTH='98%'><tr>
<TH>tname</TH><TH>tabtype</TH><TH>clusterid</TH>
</tr>
<TR valign=top>
<TD>ABALONE</TD>
<TD>TABLE</TD>
<TD align=right>&nbsp;</TD>
</TR>
<TR valign=top>
<TD>ABALONE2</TD>
<TD>TABLE</TD>
<TD align=right>&nbsp;</TD>
</TR>
<TR valign=top>
<TD>ABALONE2_TREE_JL1</TD>
<TD>TABLE</TD>
<TD align=right>&nbsp;</TD>
</TR>
<TR valign=top>
<TD>ABALONE_TREE</TD>
<TD>TABLE</TD>
<TD align=right>&nbsp;</TD>
</TR>
<TR valign=top>
<TD>ADDRESS</TD>
<TD>VIEW</TD>
<TD align=right>&nbsp;</TD>
</TR>
<TR valign=top>
<TD>ADODB_LOGSQL</TD>
<TD>TABLE</TD>
<TD align=right>&nbsp;</TD>
</TR>
<TR valign=top>
<TD>ADOXYZ</TD>
<TD>TABLE</TD>
<TD align=right>&nbsp;</TD>
</TR>
<TR valign=top>
<TD>ALERTRX</TD>
<TD>TABLE</TD>
<TD align=right>&nbsp;</TD>
</TR>
<TR valign=top>
<TD>ATEST</TD>
<TD>TABLE</TD>
<TD align=right>&nbsp;</TD>
</TR>
</TABLE>
InParameter($stmt, $php_var='Malaysia', $name='a1', $maxLen=4000, $type=false);
Bind: name = a1
-----
(oci8po): begin adodb.data_in(:a1); end;
-----
<p>Testing Bulk Insert of 3 rows</p>-----
(oci8po): insert into ADOXYZ (id, firstname, lastname) values (:0, :1, :2)
-----
-----
(oci8po): insert into ADOXYZ (id, firstname, lastname) values (:0, :1, :2)
-----
-----
(oci8po): insert into ADOXYZ (id, firstname, lastname) values (:0, :1, :2)
-----
Smart Commit occurred
-----
(oci8po): select * from ADOXYZ order by id
-----
<TABLE COLS=4 BORDER='1' WIDTH='98%'><tr>
<TH>id</TH><TH>firstname</TH><TH>lastname</TH><TH>created</TH>
</tr>
<TR valign=top>
<TD align=right>1&nbsp;</TD>
<TD>Caroline</TD>
<TD>Miranda</TD>
<TD> &nbsp; </TD>
<TD> &nbsp; </TD>
</TR>
<TR valign=top>
<TD align=right>2&nbsp;</TD>
<TD>John</TD>
<TD>Lim</TD>
<TD> &nbsp; </TD>
<TD> &nbsp; </TD>
</TR>
<TR valign=top>
<TD align=right>3&nbsp;</TD>
<TD>Wai Hun</TD>
<TD>See</TD>
<TD> &nbsp; </TD>
<TD> &nbsp; </TD>
</TR>
</TABLE>
-----
(oci8po): delete from ADOXYZ
-----
<p>Inserting 50 rows</p>-----
(oci8po): insert into ADOXYZ (id, firstname, lastname, created) values (0*10+0, ?, ?, TO_DATE('2005-05-19', 'YYYY-MM-DD'))
-----
-----
(oci8po): insert into ADOXYZ (id, firstname, lastname, created) values (1*10+0, :0, :1, TO_DATE('2005-05-19', 'YYYY-MM-DD'))
-----
-----
(oci8po): insert into ADOXYZ (id, firstname, lastname, created) values (2*10+0, ?, ?, TO_DATE('2005-05-19', 'YYYY-MM-DD'))
-----
-----
(oci8po): insert into ADOXYZ (id, firstname, lastname, created) values (3*10+0, :0, :1, TO_DATE('2005-05-19', 'YYYY-MM-DD'))
-----
-----
(oci8po): insert into ADOXYZ (id, firstname, lastname, created) values (4*10+0, ?, ?, TO_DATE('2005-05-19', 'YYYY-MM-DD'))
-----
-----
(oci8po): select count(*) from ADOXYZ
-----
-----
(oci8po): update ADOXYZ set id=id+1
-----
<p>Affected_Rows() passed</p>-----
(oci8po): select id from ADOXYZ
where id=? and created>=?
-----
<br>Bind date/integer passedBB<p><b>RecordCount returns 49</b></p><p><b>PO_RecordCount returns wrong value: 49</b></p><b><p>The fields columns <i>cannot</i> be indexed by column name.</p></b><br>Array
(
[ID] => 2
[FIRSTNAME] => John
[LASTNAME] => Lim
[CREATED] => 2005-05-19
[ABS(MOD(DBMS_RANDOM.RANDOM,10000001)/10000000)] => .0233416
)
<TABLE COLS=5 BORDER='1' WIDTH='98%'><tr>
<TH>id</TH><TH>firstname</TH><TH>lastname</TH><TH>created</TH><TH>abs(mod(dbms_random.random,10000001)/10000000)</TH>
</tr>
<TR valign=top>
<TD align=right>2&nbsp;</TD>
<TD>John</TD>
<TD>Lim</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.0233416&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>3&nbsp;</TD>
<TD>Mary</TD>
<TD>Lamb</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.1240054&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>4&nbsp;</TD>
<TD>George</TD>
<TD>Washington</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.590735&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>5&nbsp;</TD>
<TD>Mr. Alan</TD>
<TD>Tam</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.6431706&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>6&nbsp;</TD>
<TD>Alan</TD>
<TD>Turing'ton</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.1579551&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>7&nbsp;</TD>
<TD>Serena</TD>
<TD>Williams</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.5652993&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>8&nbsp;</TD>
<TD>Yat Sun</TD>
<TD>Sun</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.8400974&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>9&nbsp;</TD>
<TD>Wai Hun</TD>
<TD>See</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.8073812&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>10&nbsp;</TD>
<TD>Steven</TD>
<TD>Oey</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.1340615&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>11&nbsp;</TD>
<TD>Caroline</TD>
<TD>Miranda</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.9993386&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>12&nbsp;</TD>
<TD>John</TD>
<TD>Lim</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.7807507&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>13&nbsp;</TD>
<TD>Mary</TD>
<TD>Lamb</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.1983442&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>14&nbsp;</TD>
<TD>George</TD>
<TD>Washington</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.9449505&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>15&nbsp;</TD>
<TD>Mr. Alan</TD>
<TD>Tam</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.5663581&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>16&nbsp;</TD>
<TD>Alan</TD>
<TD>Turing'ton</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.4669657&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>17&nbsp;</TD>
<TD>Serena</TD>
<TD>Williams</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.6451908&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>18&nbsp;</TD>
<TD>Yat Sun</TD>
<TD>Sun</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.4639599&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>19&nbsp;</TD>
<TD>Wai Hun</TD>
<TD>See</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.4443077&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>20&nbsp;</TD>
<TD>Steven</TD>
<TD>Oey</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.3388362&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>21&nbsp;</TD>
<TD>Caroline</TD>
<TD>Miranda</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.8143343&nbsp;</TD>
</TR>
</TABLE>
<TABLE COLS=5 BORDER='1' WIDTH='98%'><tr>
<TH>id</TH><TH>firstname</TH><TH>lastname</TH><TH>created</TH><TH>abs(mod(dbms_random.random,10000001)/10000000)</TH>
</tr><TR valign=top>
<TD align=right>22&nbsp;</TD>
<TD>John</TD>
<TD>Lim</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.972867&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>23&nbsp;</TD>
<TD>Mary</TD>
<TD>Lamb</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.5805857&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>24&nbsp;</TD>
<TD>George</TD>
<TD>Washington</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.0551489&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>25&nbsp;</TD>
<TD>Mr. Alan</TD>
<TD>Tam</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.0705427&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>26&nbsp;</TD>
<TD>Alan</TD>
<TD>Turing'ton</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.4666325&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>27&nbsp;</TD>
<TD>Serena</TD>
<TD>Williams</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.7516632&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>28&nbsp;</TD>
<TD>Yat Sun</TD>
<TD>Sun</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.3328669&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>29&nbsp;</TD>
<TD>Wai Hun</TD>
<TD>See</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.8351005&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>30&nbsp;</TD>
<TD>Steven</TD>
<TD>Oey</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.2147344&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>31&nbsp;</TD>
<TD>Caroline</TD>
<TD>Miranda</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.8954723&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>32&nbsp;</TD>
<TD>John</TD>
<TD>Lim</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.3072688&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>33&nbsp;</TD>
<TD>Mary</TD>
<TD>Lamb</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.2168223&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>34&nbsp;</TD>
<TD>George</TD>
<TD>Washington</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.2349472&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>35&nbsp;</TD>
<TD>Mr. Alan</TD>
<TD>Tam</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.5354307&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>36&nbsp;</TD>
<TD>Alan</TD>
<TD>Turing'ton</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.4541119&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>37&nbsp;</TD>
<TD>Serena</TD>
<TD>Williams</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.6528771&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>38&nbsp;</TD>
<TD>Yat Sun</TD>
<TD>Sun</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.5078207&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>39&nbsp;</TD>
<TD>Wai Hun</TD>
<TD>See</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.2280108&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>40&nbsp;</TD>
<TD>Steven</TD>
<TD>Oey</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.0865263&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>41&nbsp;</TD>
<TD>Caroline</TD>
<TD>Miranda</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.866602&nbsp;</TD>
</TR>
</TABLE>
<TABLE COLS=5 BORDER='1' WIDTH='98%'><tr>
<TH>id</TH><TH>firstname</TH><TH>lastname</TH><TH>created</TH><TH>abs(mod(dbms_random.random,10000001)/10000000)</TH>
</tr><TR valign=top>
<TD align=right>42&nbsp;</TD>
<TD>John</TD>
<TD>Lim</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.6110876&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>43&nbsp;</TD>
<TD>Mary</TD>
<TD>Lamb</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.0870814&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>44&nbsp;</TD>
<TD>George</TD>
<TD>Washington</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.8348281&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>45&nbsp;</TD>
<TD>Mr. Alan</TD>
<TD>Tam</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.2111793&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>46&nbsp;</TD>
<TD>Alan</TD>
<TD>Turing'ton</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.2265778&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>47&nbsp;</TD>
<TD>Serena</TD>
<TD>Williams</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.6451763&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>48&nbsp;</TD>
<TD>Yat Sun</TD>
<TD>Sun</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.6077789&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>49&nbsp;</TD>
<TD>Wai Hun</TD>
<TD>See</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.1526813&nbsp;</TD>
</TR>
<TR valign=top>
<TD align=right>50&nbsp;</TD>
<TD>Steven</TD>
<TD>Oey</TD>
<TD>Thu 19, May 2005&nbsp;</TD>
<TD align=right>.2569144&nbsp;</TD>
</TR>
</TABLE>
<p>GetOne returns ok</p><p>GetRow returns ok</p><p>FetchObject/FetchNextObject Test</p>AA<p>FetchObject/FetchNextObject Test 2</p>BBArray
(
[ID] => 4
[FIRSTNAME] => George
[LASTNAME] => Washington
[CREATED] => 2005-05-19
)
<br />
<b>Notice</b>: Undefined index: id in <b>D:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php</b> on line <b>3496</b><br />
<br />
<b>Notice</b>: Undefined index: firstname in <b>D:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php</b> on line <b>3496</b><br />
<br />
<b>Notice</b>: Undefined index: lastname in <b>D:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php</b> on line <b>3496</b><br />
<br />
<b>Notice</b>: Undefined index: created in <b>D:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php</b> on line <b>3496</b><br />
adofetchobj Object
(
[ID] =>
[FIRSTNAME] =>
[LASTNAME] =>
[CREATED] =>
)
<p><b>Firstname is not string</b></p><p>CacheSelectLimit Test</p> /tmp/0d/adodb_0d16f79a74ee76ccabfb86ca1945f9ad.cache reloaded, ttl=2913 [ select * from (SELECT /*+FIRST_ROWS*/ id, firstname from ADOXYZ order by id) where rownum
typo3/sysext/adodb/adodb/tests/test-active-record.php (working copy)
<?php
include_once('../adodb.inc.php');
include_once('../adodb-active-record.inc.php');
// uncomment the following if you want to test exceptions
if (@$_GET['except']) {
if (PHP_VERSION >= 5) {
include('../adodb-exceptions.inc.php');
echo "<h3>Exceptions included</h3>";
}
}
$db = NewADOConnection('mysql://root@localhost/northwind');
$db->debug=1;
ADOdb_Active_Record::SetDatabaseAdapter($db);
$db->Execute("CREATE TEMPORARY TABLE `persons` (
`id` int(10) unsigned NOT NULL auto_increment,
`name_first` varchar(100) NOT NULL default '',
`name_last` varchar(100) NOT NULL default '',
`favorite_color` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
");
class Person extends ADOdb_Active_Record{}
$person = new Person();
echo "<p>Output of getAttributeNames: ";
var_dump($person->getAttributeNames());
/**
* Outputs the following:
* array(4) {
* [0]=>
* string(2) "id"
* [1]=>
* string(9) "name_first"
* [2]=>
* string(8) "name_last"
* [3]=>
* string(13) "favorite_color"
* }
*/
$person = new Person();
$person->name_first = 'Andi';
$person->name_last = 'Gutmans';
$person->save(); // this save() will fail on INSERT as favorite_color is a must fill...
$person = new Person();
$person->name_first = 'Andi';
$person->name_last = 'Gutmans';
$person->favorite_color = 'blue';
$person->save(); // this save will perform an INSERT successfully
echo "<p>The Insert ID generated:"; print_r($person->id);
$person->favorite_color = 'red';
$person->save(); // this save() will perform an UPDATE
$person = new Person();
$person->name_first = 'John';
$person->name_last = 'Lim';
$person->favorite_color = 'lavender';
$person->save(); // this save will perform an INSERT successfully
// load record where id=2 into a new ADOdb_Active_Record
$person2 = new Person();
$person2->Load('id=2');
var_dump($person2);
$activeArr = $db->GetActiveRecordsClass($class = "Person",$table = "persons","id=".$db->Param(0),array(2));
$person2 =& $activeArr[0];
echo "<p>Name (should be John): ",$person->name_first, " <br> Class (should be Person): ",get_class($person2);
?>
typo3/sysext/adodb/adodb/tests/test-active-recs2.php (working copy)
<?php
error_reporting(E_ALL);
include('../adodb.inc.php');
include('../adodb-active-record.inc.php');
###########################
$ADODB_ACTIVE_CACHESECS = 36;
$DBMS = @$_GET['db'];
if ($DBMS == 'mysql') {
$db = NewADOConnection('mysql://root@localhost/northwind');
} else if ($DBMS == 'postgres') {
$db = NewADOConnection('postgres');
$db->Connect("localhost","tester","test","test");
} else
$db = NewADOConnection('oci8://scott:natsoft@/');
$arr = $db->ServerInfo();
echo "<h3>$db->dataProvider: {$arr['description']}</h3>";
$arr = $db->GetActiveRecords('products',' productid<10');
adodb_pr($arr);
ADOdb_Active_Record::SetDatabaseAdapter($db);
if (!$db) die('failed');
$rec = new ADODB_Active_Record('photos');
$rec = new ADODB_Active_Record('products');
adodb_pr($rec->getAttributeNames());
echo "<hr>";
$rec->load('productid=2');
adodb_pr($rec);
$db->debug=1;
$rec->productname = 'Changie Chan'.rand();
$rec->insert();
$rec->update();
$rec->productname = 'Changie Chan 99';
$rec->replace();
$rec2 = new ADODB_Active_Record('products');
$rec->load('productid=3');
$rec->save();
$rec = new ADODB_Active_record('products');
$rec->productname = 'John ActiveRec';
$rec->notes = 22;
#$rec->productid=0;
$rec->discontinued=1;
$rec->Save();
$rec->supplierid=33;
$rec->Save();
$rec->discontinued=0;
$rec->Save();
$rec->Delete();
echo "<p>Affected Rows after delete=".$db->Affected_Rows()."</p>";
?>
typo3/sysext/adodb/adodb/tests/test-datadict.php (working copy)
<?php
/*
V4.81 3 May 2006 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Set tabs to 4 for best viewing.
*/
error_reporting(E_ALL);
include_once('../adodb.inc.php');
foreach(array('sapdb','sybase','mysql','access','oci8po','postgres','odbc_mssql','odbc','db2','firebird','informix') as $dbType) {
echo "<h3>$dbType</h3><p>";
$db = NewADOConnection($dbType);
$dict = NewDataDictionary($db);
if (!$dict) continue;
$dict->debug = 1;
$opts = array('REPLACE','mysql' => 'ENGINE=INNODB', 'oci8' => 'TABLESPACE USERS');
/* $flds = array(
array('id', 'I',
'AUTO','KEY'),
array('name' => 'firstname', 'type' => 'varchar','size' => 30,
'DEFAULT'=>'Joan'),
array('lastname','varchar',28,
'DEFAULT'=>'Chen','key'),
array('averylonglongfieldname','X',1024,
'NOTNULL','default' => 'test'),
array('price','N','7.2',
'NOTNULL','default' => '0.00'),
array('MYDATE', 'D',
'DEFDATE'),
array('TS','T',
'DEFTIMESTAMP')
);*/
$flds = "
ID I AUTO KEY,
FIRSTNAME VARCHAR(30) DEFAULT 'Joan' INDEX idx_name,
LASTNAME VARCHAR(28) DEFAULT 'Chen' key INDEX idx_name,
averylonglongfieldname X(1024) DEFAULT 'test',
price N(7.2) DEFAULT '0.00',
MYDATE D DEFDATE INDEX idx_date,
BIGFELLOW X NOTNULL,
TS T DEFTIMESTAMP";
$sqla = $dict->CreateDatabase('KUTU',array('postgres'=>"LOCATION='/u01/postdata'"));
$dict->SetSchema('KUTU');
$sqli = ($dict->CreateTableSQL('testtable',$flds, $opts));
$sqla = array_merge($sqla,$sqli);
$sqli = $dict->CreateIndexSQL('idx','testtable','price,firstname,lastname',array('BITMAP','FULLTEXT','CLUSTERED','HASH'));
$sqla = array_merge($sqla,$sqli);
$sqli = $dict->CreateIndexSQL('idx2','testtable','price,lastname');//,array('BITMAP','FULLTEXT','CLUSTERED'));
$sqla = array_merge($sqla,$sqli);
$addflds = array(array('height', 'F'),array('weight','F'));
$sqli = $dict->AddColumnSQL('testtable',$addflds);
$sqla = array_merge($sqla,$sqli);
$addflds = array(array('height', 'F','NOTNULL'),array('weight','F','NOTNULL'));
$sqli = $dict->AlterColumnSQL('testtable',$addflds);
$sqla = array_merge($sqla,$sqli);
printsqla($dbType,$sqla);
if (file_exists('d:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php'))
if ($dbType == 'mysqlt') {
$db->Connect('localhost', "root", "", "test");
$dict->SetSchema('');
$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
if ($sqla2) printsqla($dbType,$sqla2);
}
if ($dbType == 'postgres') {
if (@$db->Connect('localhost', "tester", "test", "test"));
$dict->SetSchema('');
$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
if ($sqla2) printsqla($dbType,$sqla2);
}
if ($dbType == 'odbc_mssql') {
$dsn = $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=localhost;Database=northwind;";
if (@$db->Connect($dsn, "sa", "natsoft", "test"));
$dict->SetSchema('');
$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
if ($sqla2) printsqla($dbType,$sqla2);
}
adodb_pr($dict->databaseType);
printsqla($dbType, $dict->DropColumnSQL('table',array('my col','`col2_with_Quotes`','A_col3','col3(10)')));
printsqla($dbType, $dict->ChangeTableSQL('adoxyz','LASTNAME varchar(32)'));
}
function printsqla($dbType,$sqla)
{
print "<pre>";
//print_r($dict->MetaTables());
foreach($sqla as $s) {
$s = htmlspecialchars($s);
print "$s;\n";
if ($dbType == 'oci8') print "/\n";
}
print "</pre><hr />";
}
/***
Generated SQL:
mysql
CREATE DATABASE KUTU;
DROP TABLE KUTU.testtable;
CREATE TABLE KUTU.testtable (
id INTEGER NOT NULL AUTO_INCREMENT,
firstname VARCHAR(30) DEFAULT 'Joan',
lastname VARCHAR(28) NOT NULL DEFAULT 'Chen',
averylonglongfieldname LONGTEXT NOT NULL,
price NUMERIC(7,2) NOT NULL DEFAULT 0.00,
MYDATE DATE DEFAULT CURDATE(),
PRIMARY KEY (id, lastname)
)TYPE=ISAM;
CREATE FULLTEXT INDEX idx ON KUTU.testtable (firstname,lastname);
CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
ALTER TABLE KUTU.testtable ADD height DOUBLE;
ALTER TABLE KUTU.testtable ADD weight DOUBLE;
ALTER TABLE KUTU.testtable MODIFY COLUMN height DOUBLE NOT NULL;
ALTER TABLE KUTU.testtable MODIFY COLUMN weight DOUBLE NOT NULL;
--------------------------------------------------------------------------------
oci8
CREATE USER KUTU IDENTIFIED BY tiger;
/
GRANT CREATE SESSION, CREATE TABLE,UNLIMITED TABLESPACE,CREATE SEQUENCE TO KUTU;
/
DROP TABLE KUTU.testtable CASCADE CONSTRAINTS;
/
... This diff was truncated because it exceeds the maximum size that can be displayed.
(1-1/2)