Skip to content

Commit 3ec5e77

Browse files
author
Artyom Abakumov
committed
Pass SQL with zero length in trace correctly
1 parent 90e371d commit 3ec5e77

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/jrd/trace/TraceDSQLHelpers.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ class TraceDSQLPrepare
5151
if (!m_need_trace)
5252
return;
5353

54-
m_start_clock = fb_utils::query_performance_counter();
54+
m_start_clock = fb_utils::query_performance_counter();std::string_view
5555

56-
static const char empty_string[] = "";
57-
if (!m_string_len || !string)
56+
static constexpr const char* empty_string = "<empty statement>";
57+
static FB_SIZE_T empty_string_length = fb_strlen(empty_string);
58+
if (m_string == nullptr || (m_string_len == 0 && (m_string_len = fb_strlen(m_string)) == 0))
5859
{
5960
m_string = empty_string;
60-
m_string_len = 0;
61+
m_string_len = empty_string_length;
6162
}
6263
}
6364

0 commit comments

Comments
 (0)