datagrid icon indicating copy to clipboard operation
datagrid copied to clipboard

Adding NN to query with SqlsrvDriver (Dibi\Fluent)

Open TumaMilan opened this issue 5 years ago • 0 comments

Specification

When specifying string value in query, datagrid adds two "N" before leading string apostrophe. For example: $fluent->where("type = 'type1'") datagrid represents as "WHERE type = NN'type1'"

Source

I guess the reason is double calling of method escapeText() from SqlsrvDriver. Dibi from version 4.1 adds "N" before escaped text. Calling once is OK, calling twice doubles leading "N", which MSSQL server doesn't understand.

Workaround

  • delete "N" from this method in SqlsrvDriver.php or
  • use Dibi 4.0.3 or older

TumaMilan avatar Jun 05 '20 12:06 TumaMilan