You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.
Giraffez core dumps with Segmentation fault error when giraffez.BulkLoad is called but a work table is present.
Steps to reproduce:
Create a test database:
CREATE DATABASE demo_db
AS PERMANENT = 60e6,
SPOOL = 60e6;
Execute the following python script. You may have to edit td_connection to point to your Vantage database instance.
The script drops table demo_db.test_table_wt and then creates it. It then runs giraffez.BulkLoad against demo_db.test_table. With this naming convention, the script pretends that the work table is always there.
import giraffez
td_connection = {
"host": "localhost",
"username": "dbc",
"password": "dbc"
}
try:
with giraffez.Cmd(**td_connection) as cmd:
cmd.execute("DROP TABLE demo_db.test_table_wt")
except Exception:
pass
create_ddl = "create multiset table demo_db.test_table_wt(\
INDEX_ID BIGINT)"
with giraffez.Cmd(**td_connection) as cmd:
cmd.execute(create_ddl)
show_ddl = cmd.execute("SHOW TABLE demo_db.test_table_wt")
print(list(show_ddl))
f = open("/tmp/temp.csv", "w")
f.write("1")
f.close()
with giraffez.BulkLoad(**td_connection, table="demo_db.test_table") as load:
load.from_file(
"/tmp/temp.csv",
delimiter=","
)
Result:
[Row({'request_text': 'CREATE MULTISET TABLE demo_db.test_table_wt ,FALLBACK ,\r NO BEFORE JOURNAL,\r NO AFTER JOURNAL,\r CHECKSUM = DEFAULT,\r DEFAULT MERGEBLOCKRATIO,\r MAP = TD_MAP1\r (\r index_id BIGINT)\rPRIMARY INDEX ( index_id );'})]
Segmentation fault (core dumped)
I've looked at the core dump. Backtrace points to giraffez/src/teradatapt.hpp:296 at if (err->Code == TD_SUCCESS):
Giraffez core dumps with
Segmentation fault
error whengiraffez.BulkLoad
is called but a work table is present.Steps to reproduce:
td_connection
to point to your Vantage database instance.The script drops table
demo_db.test_table_wt
and then creates it. It then runsgiraffez.BulkLoad
againstdemo_db.test_table
. With this naming convention, the script pretends that the work table is always there.I've looked at the core dump. Backtrace points to
giraffez/src/teradatapt.hpp:296
atif (err->Code == TD_SUCCESS)
:When a work table exists ExecuteCommand() returns NULL. As a result,
err
object is also NULL. Line 296 then references memory address 0.Many thanks to @acirtep for helping me identify the issue.
The text was updated successfully, but these errors were encountered: