The driver does not properly delimited all the uids for the db_update statement in system_status function in system.admin.inc.
db_update('users')
->expression('uid', 'uid - uid')
->condition('name', '')
->condition('pass', '')
->condition('status', 0)
->execute();
Part of the SQL generated from the db_update is uid=uid - uid. This is escaped by the driver as "UID"=uid - "UID". This effectively toggles the uid for anonymous between zero and the Oracle UID on each call to system_status.
Comments
Comment #1
aaaristo commentedgoing to fix it
Comment #2
aaaristo commentedfixed in 1.10
Comment #3
Richard.Li commentedI try install the driver in Win7x64, IIS7.5 with zendce pdo-oci extension, the driver seems worked OK, but dashboard display have a issue seems some things related to this problem. I am new to drupal.org, I reported problem here.
The Error is :
PDOException: SELECT * FROM (SELECT TAB.*, ROWNUM RWN_TO_REMOVE FROM (SELECT u.uid, u.name, MAX(s.timestamp) AS max_timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= :interval AND s.uid > 0 GROUP BY u.uid, u.name ORDER BY max_timestamp DESC) TAB) WHERE RWN_TO_REMOVE BETWEEN :oracle_rwn_start AND :oracle_rwn_end (prepared: SELECT * FROM (SELECT TAB.*, ROWNUM RWN_TO_REMOVE FROM (SELECT u.\"UID\", u.name, MAX(s.timestamp) max_timestamp FROM "USERS" u INNER JOIN "SESSIONS" s ON u."UID" = s."UID" WHERE s.timestamp >= :interval AND s."UID" > 0 GROUP BY u."UID", u.name ORDER BY max_timestamp DESC) TAB) WHERE RWN_TO_REMOVE BETWEEN :oracle_rwn_start AND :oracle_rwn_end ) e: SQLSTATE[HY000]: General error: 911 OCIStmtExecute: ORA-00911: 无效字符 (ext\pdo_oci\oci_statement.c:148) args: Array ( [:interval] => 1328351703 [oracle_rwn_start] => 1 [oracle_rwn_end] => 10 ) in user_block_view() (line 1420 of E:\WWW\drupal\modules\user\user.module).I have rechecked Error,
SELECT u.\"UID\"Escaping of uid is not handled properly obviously. so please fix it.Comment #4
aaaristo commentedlooks like you have a problem in your php intallation, run this:
i get:
SELECT * FROM (SELECT TAB.*, ROWNUM RWN_TO_REMOVE FROM (SELECT u."UID", u.name, MAX(s.timestamp) AS max_timestamp FROM "{USERS}" u INNER JOIN "{SESSIONS}" s ON u."UID" = s."UID" WHERE s.timestamp >= :interval AND s."UID" > 0 GROUP BY u."UID", u.name ORDER BY max_timestamp DESC) TAB) WHERE RWN_TO_REMOVE BETWEEN :oracle_rwn_start
Comment #5
Richard.Li commentedI tested this function, that is no problem, both your code and my system code in database.inc. but Error still there. may be somewhere else.
Comment #6
minoroffense commentedWe're getting the same error as described above when trying to upgrade from 1.9 to 1.10.
I tried running that function and got the following output:
Comment #7
aaaristo commentedcan you please tell me on which url? doing what? how can i reproduce it
Comment #8
minoroffense commentedSure thing.
We're hdt getting access to the oracle query log. Onc I have that I'll supply a full list of proper debug info.
Comment #9
minoroffense commented- This only appears when the user is authenticated.
- This occurs on any page I visit on our site as an authenticated user
- Waiting on the DBA to get me the logs from their end.
Driver/Environment Info
- PDO_OCI
- PDO Driver for OCI 8 and later
- Window Server 2008 R2 Standard SP1 (64bit)
- PHP 5.3.8
- Windows NT NCRWS377 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
- Architecture x86
- Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet" "--with-mcrypt=static" "--disable-static-analyze"
- Server API CGI/FastCGI
- Loaded Configuration File C:\Program Files (x86)\PHP\v5.3\php.ini
Comment #10
minoroffense commentedIf I comment out this query in the user.module (see line 1420), the site works once again:
Disabling the "Who's Online" block on all displays also works (and is the way I've fixed our sites for the moment).
Comment #11
aaaristo commentedok initial workaround database.inc line 405 comment out $oquery= $this->escapeTableAlias($oquery);:
Comment #12
aaaristo commentedremoved escapeTableAlias support
fixed in 1.11