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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Pull Requests

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: Tue Dec 03 17:01:29 2024 UTC