Skip to content

Commit 32a50dc

Browse files
NoremosArtyom Abakumov
andauthored
Fix SQL length initialization for trace prepare event (#8738)
Co-authored-by: Artyom Abakumov <[email protected]>
1 parent f9194aa commit 32a50dc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/jrd/trace/TraceDSQLHelpers.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ class TraceDSQLPrepare
5454
m_start_clock = fb_utils::query_performance_counter();
5555

5656
static const char empty_string[] = "";
57-
if (!m_string_len || !string)
57+
if (!string)
5858
{
5959
m_string = empty_string;
6060
m_string_len = 0;
6161
}
62+
else if (m_string_len == 0)
63+
m_string_len = fb_strlen(m_string);
6264
}
6365

6466
~TraceDSQLPrepare()

src/utilities/ntrace/TracePluginImpl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,8 @@ void TracePluginImpl::logRecordStmt(const char* action, ITraceDatabaseConnection
525525

526526
if (reg)
527527
{
528+
fb_assert(false);
529+
528530
string temp;
529531
temp.printf(NEWLINE "Statement %" SQUADFORMAT", <unknown, bug?>:" NEWLINE, stmt_id);
530532
record.insert(0, temp);

0 commit comments

Comments
 (0)