Skip to content

pdo_dblib wrong protocol version 5.0 #13475

Open

Description

@hanisko

Description

The following code:

<?php
$connection = new PDO('dblib:version=5.0;host=example', 'username', 'password');

Problem is with Sybase System 10 and above > use protocol version 5.0 but here link

{"5.0",DBVERSION_70} /* FIXME: This does not work with Sybase, but environ will */
  • sybase generate error log after each connection (try to connect with protocol version 7.0)
server  Error: 1621, Severity: 18, State: 1
server  Type '12' not allowed before login.

PHP Version

PHP 8.2

Operating System

No response

Activity

  1. SakiTakamachi commented on Feb 23, 2024

    @SakiTakamachi
    Member

    I'll confirm this by early next week.

  2. SakiTakamachi commented on Feb 26, 2024

    @SakiTakamachi
    Member

    There are so many ways to install sybase that I don't know which is the correct one...
    Is there a recommended method?

  3. hanisko commented on Feb 27, 2024

    @hanisko
    Author

    There are so many ways to install sybase that I don't know which is the correct one... Is there a recommended method?

    You can install it via enterprise edition:
    https://www.sap.com/products/technology-platform/sybase-ase/trial.html

    SAP ASE, enterprise edition, contains all options for your evaluation. It expires after 90 days and can be used only in nonproduction environments.

  4. hanisko commented on Feb 29, 2024

    @hanisko
    Author

    Here is repository, which simulate 5.0 protocol bug https://github.com/hanisko/php_dblib (sybase 16 + latest php)

  5. SakiTakamachi commented on Feb 29, 2024

    @SakiTakamachi
    Member

    @hanisko
    Thank you, docker-compose.yml in your repository was very helpful.
    But I'm sorry. I actually just moved and my internet is incredibly slow until March 7th. I'm trying to download sybase, but I suspect it will be March 7th before that...

    It may not be until March 7th that we can properly investigate this issue.

  6. SakiTakamachi commented on Feb 29, 2024

    @SakiTakamachi
    Member

    Suddenly, my unstable internet connection suddenly became faster and by chance I was able to download all of sybase.
    I was able to reproduce it in my environment as well. I'll investigate this issue.

  7. SakiTakamachi commented on Feb 29, 2024

    @SakiTakamachi
    Member

    @hanisko

    I got it.

    I will write from the conclusion, please try specifying 10.0 instead of 5.0. Perhaps it will do what you want.


    in detail

    Excerpt from the following page:
    https://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc20155_1251/html/newfesd/BABHHDEI.htm

    DBVERSION_100 — DB-Library is running with TDS version 5.0 protocol

    I've found some of the same information on other sites, so it seems certain that DBVERSION_100 means 5.0.

    But PHP seems to have been interpreting this as 10.0 for a long time.

    ,{"10.0",DBVERSION_100}

    Fixing this will definitely result in a BC Break, so it can't be fixed, at least not on the stable branch. It may be possible to fix it in the master branch (future 8.4), but first I need to investigate the scope of the impact of fixing this.

  8. hanisko commented on Mar 1, 2024

    @hanisko
    Author

    Yes, you are right, "10.0" solved the issue, it doesn't generate "Error: 1621, Severity: 18, State: 1" into sybae logs.

    Comment on line 450 "FIXME: This does not work with Sybase" and pointig version 5.0, 6.0, 7.0 to same value "DBVERSION_70" confused me. Maybe just better documentation for "version" values in dsn will be helpfull https://www.php.net/manual/en/ref.pdo-dblib.connection.php

    This comment was also confusing https://www.php.net/manual/en/ref.pdo-dblib.connection.php#118644 where is statement about "version from dsn" = "tds version" which is not correct with 5.0 protocol (only info in docs about version in dsn)

    I hope it will be better documented or fixed in future versions.

    Thanks for your help :-)

  9. SakiTakamachi commented on Mar 4, 2024

    @SakiTakamachi
    Member

    I have posted about this issue to the mailing list.
    https://externals.io/message/122538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions