04.04.2022 19:06, Dimitry Sibiryakov wrote:
   Hello.

  I've found that for versions 3 and 4 in trace_dsql_prepare() statement->getText() returning SQL statement text converted into UTF-8 and getTextUTF8() - returning it converted twice.

  ITraceSQLStatement::getTextUTF8() is not used by trace plugin since v3 as
engine already converts SQL statement text into UTF8 encoding. Therefore
second conversion was not noticed so far. BTW, in v2.5 this method was used
for regexp matching only (include\exclude_filter).

  Note, engine convert statement text into UTF8 after successful parsing only,
therefore statement text reported by failed prepare could be not converted and
put into trace\audit log as it was supplied by client.

   It is reproducible even with standard trace plugin (audit log as seen in 
ANSI mode):

  Since v3 trace\audit log considered to be in UTF8.

Statement 32:
-------------------------------------------------------------------------------
select * from "абв"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Select Expression
    -> Table "абв" Full Scan
      1 ms

  Here conversion from UTF8 back to connection charset happens at OPT_get_plan()
that call RecordSource::printName(). Looks like we should find a way to disable
such conversion when it is not needed.

   Is it really supposed to work this way?


  We trying to do as much as possible to put UTF8 data into trace\audit log.
If some parts are not converted - it should be found and fixed.

Regards,
Vlad


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to