Skip to content

Commit

Permalink
Change PLG$PROF_RECORD_SOURCES.ACCESS_PATH to VARCHAR(255) as documen…
Browse files Browse the repository at this point in the history
…ted. Thanks to Mark.
  • Loading branch information
asfernandes committed May 18, 2023
1 parent 953c9f1 commit e43bfdd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/profiler/Profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace

class ProfilerPlugin;

constexpr unsigned MAX_ACCESS_PATH_CHAR_LEN = 255;

auto& defaultPool()
{
return *getDefaultMemoryPool();
Expand Down Expand Up @@ -416,7 +418,7 @@ void ProfilerPlugin::flush(ThrowStatusExceptionWrapper* status)
(FB_INTEGER, cursorId)
(FB_INTEGER, recordSourceId)
(FB_INTEGER, parentRecordSourceId)
(FB_INTL_VARCHAR(1024 * 4, CS_UTF8), accessPath)
(FB_INTL_VARCHAR(MAX_ACCESS_PATH_CHAR_LEN * 4, CS_UTF8), accessPath)
) recSrcMessage(status, MasterInterfacePtr());
recSrcMessage.clear();

Expand Down Expand Up @@ -998,7 +1000,7 @@ void ProfilerPlugin::createMetadata(ThrowStatusExceptionWrapper* status, RefPtr<
cursor_id integer not null,
record_source_id integer not null,
parent_record_source_id integer,
access_path varchar(1024) character set utf8 not null,
access_path varchar(255) character set utf8 not null,
constraint plg$prof_record_sources_pk
primary key (profile_id, statement_id, cursor_id, record_source_id)
using index plg$prof_record_sources_profile_statement_cursor_recsource,
Expand Down Expand Up @@ -1401,8 +1403,6 @@ void Session::defineRecordSource(SINT64 statementId, unsigned cursorId, unsigned

recSource->accessPath = accessPath;

constexpr unsigned MAX_ACCESS_PATH_CHAR_LEN = 1024;

if (unsigned len = recSource->accessPath.length(); len > MAX_ACCESS_PATH_CHAR_LEN)
{
auto str = recSource->accessPath.c_str();
Expand Down

0 comments on commit e43bfdd

Please sign in to comment.