Skip to content

ext/pdo_odbc: infinite loop / 100% CPU when fetching a large nvarchar(max) via MS ODBC Driver 18 — SQLGetData is called with a 1-byte buffer and the loop never makes progress (distinct from GH-21534) #23443

Closed

Description

@chep6915

Description

pdo_odbc_issue.md

[ODBC][45576][...][SQLGetData.c][237]
Entry:
Statement = 0x909c88000
Column Number = 1
Target Type = 1 SQL_CHAR
Buffer Length = 1
Target Value = 0x106bfb860
StrLen Or Ind = 0x10741a850
[ODBC][45576][...][SQLGetData.c][545]
Exit:[SQL_SUCCESS_WITH_INFO]
Buffer = Indicator = -4
Strlen Or Ind = 0x10741a850 -> -4 (64 bits)

PHP Version

PHP 8.5.8 (cli) (built: Jul  1 2026 03:46:27) (NTS)
Copyright (c) The PHP Group
Built by Homebrew
Zend Engine v4.5.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.8, Copyright (c), by Zend Technologies

Operating System

macOS 26.5.2 (build 25F84), Apple Silicon / arm64 (Darwin 25.5.0)

Activity

  1. added 2 commits that reference this issue on Aug 25, 2026
    c04c51f
    97499c5
  2. chep6915 commented on Aug 26, 2026

    @chep6915
    Author

    Thank you for the quick diagnosis and fix — the inverted SQL_NO_TOTAL condition matches exactly what we traced (SQLGetData being called with a 1-byte buffer and spinning). Really appreciate the fast turnaround and the regression test.

  3. added a commit that references this issue on Aug 26, 2026
    3171a6c
  4. added 3 commits that reference this issue on Sep 24, 2026
    741e683
    c675d81
    a4c4173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions