This file contains summaries of *ALL* changes we made to adodb library,
please keep this file up to date when making changes to the library
so we have an easy cheatsheet when upgrading and have a document ready
when we want things merged into the upstream code.

=============================================================
Changes made to ADOdb library ONLY in this Xaraya 1.1.x series
=============================================================
2006-07-02: Update adodb version in repo to 4.90
            Removed server.php [Bug 5233]
            No other changes applied, the sqlite files retained as per prior notes for this 1.1.x series

2006-03-05:
        drivers/adodob-xarsqlite.inc.php:
                override the recordset class too, the associative
                returns of sqlite somehow include the table name 
                (only observed when aliased in the query, since not
                many modules use GetRowAssoc() ) (cfr. mime module )

2006-02-19: Current adodb version in repo: 4.71-1
            None of the specific xaraya changes in the 1.0.x series
            have been made at this stage. Only xaraya class extension
            files and xartests directory added, and this xarchanges.txt file.
            1.0.x series changes have been left for reference.

            html/xaradodb/datadict/datadict-sqlite.inc.php is our file
            and retained for this series.
            
File removal: server.php [Bug 5233] Xaraya Directory Traversal Vulnerability


=============================================================
Changes made to ADOdb library ONLY in the Xaraya 1.0.x series
=============================================================
adodb.inc.php, line 765-773:

        // XARAYA MODIFICATION - START
        if (xarCoreIsDebugFlagSet(XARDBG_SQL)) {
            global $xarDebug_sqlCalls;
            $xarDebug_sqlCalls++;
            // initialise time to render by proca
            $lmtime = explode(' ', microtime());
            $lstarttime = $lmtime[1] + $lmtime[0];
        }
        // XARAYA MODIFICATION - END

adodb.inc.php, lines 838 - 846:

           // XARAYA MODIFICATION - START
            //  time to render SQL by proca
            if (xarCoreIsDebugFlagSet(XARDBG_SQL)) {
                $lmtime = explode(" ", microtime());
                $lendtime = $lmtime[1] + $lmtime[0];
                $ltotaltime = ($lendtime - $lstarttime);
                xarLogMessage("Query ($ltotaltime Seconds): ".$sql);
            }
            // XARAYA MODIFICATION - END

adodb.inc.php, lines 868-876:

        // XARAYA MODIFICATION - START
        //  time to render SQL by proca
        if (xarCoreIsDebugFlagSet(XARDBG_SQL)) {
            $lmtime = explode(" ", microtime());
            $lendtime = $lmtime[1] + $lmtime[0];
            $ltotaltime = ($lendtime - $lstarttime);
            xarLogMessage("Query ($ltotaltime Seconds): ".$sql);
        }
        // XARAYA MODIFICATION - END

Reason:
        Gathering xaraya specific debug information
        when the sql debug flag is set
        Changes were made by proca (2001-2002)

Upstream:    
        No, xaraya specific, not a general issue

Notes:
        - the 3 changes are not equal, the first counts the sqlCalls, the other two do not, intentional?
        - can we move this into a function in one place? easier to maintain.



adodb.inc.php lines 906- 920:

        // XARAYA MODIFICATION - START - TURN OFF/ON ERROR HANDLER
        // execute is allowed to fail getting the next sequence
        // as it will create it if it does not exist

		//$getnext = sprintf($this->_genIDSQL,$seqname);
		//$holdtransOK = $this->_transOK;
		//$rs = @$this->Execute($getnext);

        $errorfn = $this->raiseErrorFn;
        $this->raiseErrorFn = false;
        $getnext = sprintf($this->_genIDSQL,$seqname);
		$holdtransOK = $this->_transOK;
        $rs = $this->Execute($getnext);
        $this->raiseErrorFn = $errorfn;
        // XARAYA MODIFICATION - END - TURN OFF/ON ERROR HANDLER

Reason:
        ??
        Change was made by wb9tpg (Dec 23 15:49:28 2002)
        Comment: "Add ADODB exceptions"

Upstream:
        ??


drivers/adodb-postgres64.inc.php lines 84-96:
    // XARAYA MODIFICATION - START
	//var $_genIDSQL = "SELECT NEXTVAL('%s')";
	//var $_genSeqSQL = "CREATE SEQUENCE %s START %s";
	//var $_dropSeqSQL = "DROP SEQUENCE %s";
    // Prefix the sequence number to make it unique
    var $_genIDSQL = "SELECT NEXTVAL('seq%s')";
    var $_genSeqSQL = "CREATE SEQUENCE seq%s START %s";
	var $_dropSeqSQL = "DROP SEQUENCE seq%s";
    // XARAYA MODIFICATION - END

Reason:
        prefixing the sequence number (number?) to make it unique

        Change was made by wb9tpg (Mon Oct 28 02:07:59 2002)
        Comment: "Prefix the sequence number for postgers so
        it'll be different than the table name.  
        It'll fail with adodb if they are the same."

Upstream:         
        seems like a general issue, not sure


drivers/adodb-postgres64.inc.php lines 144-149:

        // XARAYA MODIFICATION - START
		//if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false;
	   	//return pg_getlastoid($this->_resultid);
        // return the GenID value
        return $this->genID;
        // XARAYA MODIFICATION - END

Reason:
        ??
        Change was made by wb9tpg (Oct 29 00:52:44 2002)
        Comment: "Postgres Specific Updates"

Upstream:
        ??

drivers/adodb-postgres64.inc.php lines 580-584:

        // XARAYA MODIFICATION - START
        // XARAYA TO DO - find out why following line fails
        // $this->Execute("set datestyle='ISO'");
        // XARAYA MODIFICATION - END

Reason:
        the statement failed
        Change was made by wb9tpg (Mon Oct 28 02:07:59 2002)

Upstream:
        not literally i think, but once we know why it fails this seems like a general problem


drivers/adodb-oci8.inc.php lines 54-61:

    // XARAYA MODIFICATION - START
	//var $_genIDSQL = "SELECT (%s.nextval) FROM DUAL";
	//var $_genSeqSQL = "CREATE SEQUENCE %s START WITH %s";
	//var $_dropSeqSQL = "DROP SEQUENCE %s";
	var $_genIDSQL = "SELECT (seq%s.nextval) FROM DUAL";
	var $_genSeqSQL = "CREATE SEQUENCE seq%s START WITH %s";
	var $_dropSeqSQL = "DROP SEQUENCE seq%s";
    // XARAYA MODIFICATION - END

Reason:
        making the sequences unique?
        Change was made by rcave (Aug 18 18:07:34 2003)
        Comment: "Prefix Oracle sequence names with 'seq' as we do in PostgreSQL"

Upstream:
        ??


adodb-datadict.inc.php lines 16-24:

    // XARAYA MODIFICATION - START
    // Fallback function for ctype_alnum (necessary for some earlier versions of PHP)
    // This could be moved to a core script to allow support for other modules too.
    if (!function_exists('ctype_alnum')) {
        function ctype_alnum($text) {
            return preg_match('/^[a-z0-9]*$/i', $text);
        }
    }
    // XARAYA MODIFICATION - END

Reason:
        ctype_alnum function is not always present in php installs
        Change was made by judgej (Dec 29 22:17:35 2003)

Upstream:
        yes


adodb-datadict.inc.php lines 577-585:

        // XARAYA MODIFICATION - START
		// if (!$colarr) return $this->CreateTableSQL($tablename,$flds,$tableoptions);
		if (!$colarr) {
            if (xarExceptionId()) {
                xarExceptionHandled();
            }
            return $this->CreateTableSQL($tablename,$flds);
        }
        // XARAYA MODIFICATION - END

Reason:
        inserting exception code for xaraya

        Change was made by judgej (Nov 29 22:09:39 2003)
        Comment: "ChangeTableSQL() - handle Xaraya exception raised when table needs creating"

Upstream:
        no, xaraya specific


drivers/adodb-mysql.inc.php lines 28-31:

// XARAYA MODIFICATION - START
	//var $hasGenID = true;
	var $hasGenID = false;
// XARAYA MODIFICATION - END

Reason:
        legacy change, makes things easier for us
        Change was made by proca (Apr 13 23:09:17 2002)
        Comment: "Fix for GenID"

Upstream:
        no

drivers/adodb-mysql.inc.php lines 49-52:

// XARAYA MODIFICATION - START
		//$arr['description'] = $this->GetOne("select version()");
        $arr['description'] = ADOConnection::GetOne("select version()");
// XARAYA MODIFICATION - END

Reason:
        on versions 3 and 4 of mysql behaviour is different
        Change was made by judgej (Jan  1 12:35:48 2004)
        Comment: "neater solution: force use of parent object method"

Upstream:
        yes

        judgej: I'm pushing a change to this, as recommended by John Lim,
        that simply forces a fallback to the parent object. That particular
        change will be incorporated into future versions of ADODB.

drivers/adodb-mysql.inc.php lines 194-198:

        // XARAYA MODIFICATION - START
		// // post-nuke sets hasGenID to false
		//if (!$this->hasGenID) return false;
        if (!$this->hasGenID) return 0;
        // XARAYA MODIFICATION - END

Reason:
        legacy change?
        Change was made by proca (Apr 13 23:09:17 2002)
        Comment: "Fix for GenID"

Upstream:
        no


Misc changes:
        index.html was added to all cats
        Reason: security reason

        copy all icons from cute_icons_for_site/* to xaradodb
        Reason: legacy change


datadict/datadict-mssql.inc.php lines 127-137:

        // XARAYA MODIFICATION - START
		// We need support for DEFAULT ''
		//if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
		if (strlen($fdefault)) {
			$suffix .= " DEFAULT $fdefault";
		} elseif (isset($fdefault) && $fdefault === '') {
			$suffix .= " DEFAULT ''";
		}
		// We use GenID() instead
		//if ($fautoinc) $suffix .= ' IDENTITY(1,1)';
        // XARAYA MODIFICATION - END

Reason:
	- IDENTITY and GenID() don't work well together
	- DEFAULT '' was not supported here, perhaps due to ADODB's weird
	  datadict syntax : DEFAULT some value without quotes

Upstream:
	(?)


drivers/adodb-xarmssql.inc.php (new) :

	Increase .ini settings for mssql.textsize and mssql.textlimit
	GenID() and _insertid() replacement for adodb-mssql.inc.php
	Replace single spaces by empty strings again in query results

