Problem/Motivation
When trying to install Drupal 7.85 on PHP 8.1 and PostgreSQL 11, this deprecated message appears:
Deprecated function: fwrite(): Passing null to parameter #2 ($data) of type string is deprecated in InsertQuery_pgsql->execute() (line 33 of xxx\includes\database\pgsql\query.inc).
It will appear after database credentials are entered and installation process is in the batch where all modules are being installed.
This message is not present while installing Drupal 7.85 on MySQL database.
Steps to reproduce
Issue can be reproduced on clean Drupal 7.85 install:
- Install Drupal 7.85 with standard profile
- Enter PostgreSQL database credentials and proceed to the next step
- The deprecated message will be shown while batch is installing modules
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3259482
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3259482-d7-php-8.1
changes, plain diff MR !1708
Comments
Comment #2
liam morlandThis bug prevents testing on Postgres; example.
Comment #4
liam morlandComment #5
liam morlandThe Postgres test fails, but it gets further than it does without the patch. Now it is failing with a bunch of "Duplicate table" errors.
Comment #6
poker10 commentedWell, it seems like that there was a new test (TEST_UPPERCASE) introduced by this issue: #2802159: [D7] SQL layer: $match_operator is vulnerable to injection attack and this commit https://git.drupalcode.org/project/drupal/-/commit/093e02fb731756bcc75b0c7af0228357034f2822 and this changes were not tested against PostgreSQL database.
The issue with TEST_UPPERCASE seems to be that in PostgreSQL all identifiers are alway folded to lowercase. See: https://www.postgresql.org/docs/14/sql-syntax-lexical.html
And we use it this way (without quotes):
So maybe it is time to create another issue with this regression.
Comment #7
liam morlandYes, the present issue is only about fwrite(). This needs to be committed even if tests do not pass on Postgres. We need a new issue for this problem, probably a child of #710858: Meta issue: fix the remaining PostgreSQL bugs.
Comment #8
poker10 commentedI have created a new issue and linked it - #3262341: [D7] Database test table TEST_UPPERCASE causes PostgreSQL tests to fail.
Comment #9
poker10 commentedSome other exceptions in the PostgreSQL tests seems to be caused by this issue (still missing D7 backport) - #998898: Make sure that the identifiers are not more the 63 characters on PostgreSQL (PostgreSQL limit for indentifiers is 63 characters). Linking it here also.
Comment #11
mcdruid commentedThanks for this, and filing the other PostgreSQL issues.