Skip to content

pyvertica handles record terminator wrong #25

@JeffAMcGee

Description

@JeffAMcGee

If you insert a value that contains the record terminator, which defaults to '\x01', then pyvertica does not encode it correctly. Here's a test program:

from pyvertica.batch import VerticaBatch

vb = VerticaBatch(
    odbc_kwargs={'dsn': 'toy'},
    reconnect=False,
    table_name='books',
    column_list=['name','price','author'],
)

vb.insert_list( [u'a fail\x01ure',5,'me'] )
vb.commit()

error_bool, error_file_obj = vb.get_errors()
if error_bool:
    print error_file_obj.read()

It produces this result:

Rejected data at line: "a fail

It also successfully creates a book with the name "ure, price 5, and author me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions