Skip to content

PDO: Migrate maxlen of pdo_column_data from size_t to zend_long #19144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marc-mabe
Copy link
Contributor

@marc-mabe marc-mabe commented Jul 16, 2025

This is returned in PDOStatement::getColumnMeta as len documented as "The length of this column. Normally -1 for types other than floating point decimals."

Also, It was as FIXME already.

  • pgsql: PQfsize: returns the space allocated for this column in a database row, in other words the size of the server's internal representation of the data type. (Accordingly, it is not really very useful to clients.) A negative value indicates the data type is variable-length.
  • dblib: dbcollen: The maximum length, in bytes, of the data for the particular column. If the column number is not in range, dbcollen returns -1.
  • firebird: XSQLVAR.sqllen -> ISC_SHORT -> signed short: length of data area
  • mysql: MYSQL_FIELD.length
    • MYSQLND_FIELD.length -> zend_ulong: Width of column (create length)
    • libmysql: unsigned long length : Width of column (create length)

I noticed this during my work of 64bit integers on 32bit arch where it would was failing: https://github.com/php/php-src/actions/runs/16311803646/job/46068812948#step:9:2782

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

Successfully merging this pull request may close these issues.

1 participant