php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78470 odbc_specialcolumns() no longer accepts $nullable parameter
Submitted: 2019-08-28 13:04 UTC Modified: 2020-09-23 18:00 UTC
From: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: ODBC related
PHP Version: 7.2Git-2019-08-28 (Git) OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2019-08-28 13:04 UTC] cmb@php.net
Description:
------------
odbc_specialcolumns() is supposed to accept a 7th parameter
$nullable; this is no longer the case as of PHP 7.0.0[1].  Since
this parameter cannot be passed anymore, some arbitrary value will
be used internally, which likely lets the function fail (which
happens to me, see test script), or uses some arbitrary (allowed)
value.

[1] <https://github.com/php/php-src/commit/e8fcd52ef1d2bb215aa40a4b8507a760079e0497#diff-e7dfa5ff1b47832265dcb9426b0af690L3608-R3608>

Test script:
---------------
<?php

$conn = odbc_connect($dsn, $user, $pass);
var_dump(($res = odbc_specialcolumns($conn, SQL_BEST_ROWID, 'TutorialDB', 'dbo', 'TEST', SQL_SCOPE_CURROW)));
var_dump(odbc_fetch_array($res));


Expected result:
----------------
resource(5) of type (odbc result)
array(8) {
  ["SCOPE"]=>
  string(1) "0"
  ["COLUMN_NAME"]=>
  string(2) "id"
  ["DATA_TYPE"]=>
  string(1) "4"
  ["TYPE_NAME"]=>
  string(3) "int"
  ["COLUMN_SIZE"]=>
  string(2) "10"
  ["BUFFER_LENGTH"]=>
  string(1) "4"
  ["DECIMAL_DIGITS"]=>
  string(1) "0"
  ["PSEUDO_COLUMN"]=>
  string(1) "1"
}

Actual result:
--------------
Warning: odbc_specialcolumns(): SQL error: Failed to fetch error message, SQL state HY000 in SQLSpecialColumns in %s on line %d
bool(false)

Warning: odbc_fetch_array() expects parameter 1 to be resource, boolean given in %s on line %d
NULL


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-23 18:00 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2020-09-24 10:24 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=610e7d2c77f7af3cc69399e0fdcca0d99300e2ce
Log: Fix #78470: odbc_specialcolumns() no longer accepts $nullable
 [2020-09-24 10:24 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 09:01:28 2024 UTC