Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Char/varchar data type does not supports the ISO Latin-9 code set #7

Closed
shabbir10july opened this issue Sep 11, 2020 · 0 comments
Closed
Assignees

Comments

@shabbir10july
Copy link
Contributor

Steps to repro:

NZPY_TEST.ADMIN(ADMIN)=> \d t1
Table "T1"
Attribute | Type | Modifier | Default Value
-----------+-----------------------+----------+---------------
C1 | CHARACTER VARYING(12) | |
Distributed on hash: "C1"

NZPY_TEST.ADMIN(ADMIN)=> select * from t1;
C1

©
(1 row)

import nzpy
conn = nzpy.connect(user="xxx", password="xxx",host='localhost', port=5480, database="nzpy_test", securityLevel=0)
cursor = conn.cursor()
pdb.set_trace()
cursor.execute("select * from t1")
results = cursor.fetchall()
for c1 in results:
    print("c1 = %s" % (c1))

[nz@sim-ips26 testcases]$ python3 run.py
Traceback (most recent call last):
  File "run.py", line 6, in <module>
    cursor.execute("select * from t1")
  File "/usr/local/lib/python3.6/site-packages/nzpy/core.py", line 842, in execute
    self._c.execute(self, operation, args)
  File "/usr/local/lib/python3.6/site-packages/nzpy/core.py", line 1797, in execute
    response = self.connNextResultSet(cursor)
  File "/usr/local/lib/python3.6/site-packages/nzpy/core.py", line 1853, in connNextResultSet
    self.Res_read_dbos_tuple(cursor, self.tupdesc)
  File "/usr/local/lib/python3.6/site-packages/nzpy/core.py", line 2028, in Res_read_dbos_tuple
    value = str(fieldDataP[2:cursize+2], self._client_encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 0: invalid start byte	


@shabbir10july shabbir10july self-assigned this Sep 11, 2020
@shabbir10july shabbir10july changed the title Char/varchar data type supports the ISO Latin-9 code set Char/varchar data type does not supports the ISO Latin-9 code set Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant