Skip to content

Unit Test Failure: GaussDBSyntaxError due to syntax error at or near "$1" in test_void  #7

@setoru

Description

@setoru

Description:
When running the test case tests/test_codecs.py::TestCodecs::test_void, a GaussDBSyntaxError occurs due to a syntax error at or near "$1".

Logs:

Traceback (most recent call last):
  File "/usr/lib64/python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/lib64/python3.9/unittest/case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "/usr/lib64/python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "/home/gaussdbuser/gaussdb-python-async/venv/lib64/python3.9/site-packages/async_gaussdb/_testbase/__init__.py", line 92, in wrapper
    self.loop.run_until_complete(coro)
  File "/usr/lib64/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/gaussdbuser/gaussdb-python-async/tests/test_codecs.py", line 571, in test_void
    await self.conn.fetchval('select now($1::void)', '')
  File "/home/gaussdbuser/gaussdb-python-async/venv/lib64/python3.9/site-packages/async_gaussdb/connection.py", line 715, in fetchval
    data = await self._execute(query, args, 1, timeout)
  File "/home/gaussdbuser/gaussdb-python-async/venv/lib64/python3.9/site-packages/async_gaussdb/connection.py", line 1865, in _execute
    result, _ = await self._execute(
  File "/home/gaussdbuser/gaussdb-python-async/venv/lib64/python3.9/site-packages/async_gaussdb/connection.py", line 1962, in _execute
    result = await self._do_execute(
  File "/home/gaussdbuser/gaussdb-python-async/venv/lib64/python3.9/site-packages/async_gaussdb/connection.py", line 2005, in _do_execute
    stmt = await self._get_statement(
  File "/home/gaussdbuser/gaussdb-python-async/venv/lib64/python3.9/site-packages/async_gaussdb/connection.py", line 439, in _get_statement
    statement = await self.protocol.prepare(
  File "async_gaussdb/protocol/protocol.pyx", line 165, in prepare
    return await waiter
async_gaussdb.exceptions.GaussDBSyntaxError: syntax error at or near "$1"

How to reproduce it:

pytest --durations=0 -s -v tests/test_codecs.py

Expected Behavior
Test passes without syntax errors.

Actual Behavior
A GaussDBSyntaxError occurs due to an issue with the parameter placeholder "$1" in the SQL query.

Environment

  • OS: Huawei Cloud EulerOS 2.0
  • Database: GaussDB Kernel 505.2.1.SPC0800 build 3e43b3bc

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