php / php/pecl-database-pdo_ibm

empty string used with concatenation terminates string in SQL early

Open
#22 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
20
Forks
14
PR merge metrics
No merged PRs in 30d

Description

In a3c9fe96549884a30dce4b87e4779bfc0627d36d, some code like values('%' || ? || '%') with a bound empty string will return '%' instead of the expected '%' (in i.e. ibm_db2). Are we doing the right thing with null termination here? What are we doing differently?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the values('%' || ? || '%') query from commit a3c9fe96549884a30dce4b87e4779bfc0627d36d with a bound empty string on IBM DB2. Inspect the PDO driver's bound-value handling and null termination behavior; done means the observed concatenation behavior is explained and any needed correction is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.