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

taos.error.ProgrammingError: [0x0216]: syntax error near 'unrecognized token: ""' #26407

Open
jiabaoyu114 opened this issue Jul 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jiabaoyu114
Copy link

============================= test session starts =============================
collecting ... collected 1 item

connect_example.py::test_connection FAILED [100%]client info: 2.6.0.34
server info: 2.6.0.12

connect_example.py:10 (test_connection)
def test_connection():
# all parameters are optional.
# if database is specified,
# then it must exist.
conn = taos.connect(host="192.168.1.206",
port=6030,
user="root",
password="taosdata",
database="fastbee_log")
print('client info:', conn.client_info)
print('server info:', conn.server_info)

  result: taos.TaosResult = conn.query("select * from device_d1124a81570s")

connect_example.py:22:


C:\DevelopmentLanguage\python\Python38\lib\site-packages\taos\connection.py:85: in query
res = taos_query(self._conn, sql)


connection = c_void_p(1526890475472), sql = 'select * from device_d1124a81570s'

def taos_query(connection, sql):
    # type: (c_void_p, str) -> c_void_p
    """Run SQL

    - sql: str, sql string to run

    @return: TAOS_RES*, result pointer

    """
    try:
        ptr = c_char_p(sql.encode("utf-8"))
        res = c_void_p(_libtaos.taos_query(connection, ptr))
        errno = taos_errno(res)
        if errno != 0:
            errstr = taos_errstr(res)
            taos_free_result(res)
          raise ProgrammingError(errstr, errno)

E taos.error.ProgrammingError: [0x0216]: syntax error near 'unrecognized token: "��"'

C:\DevelopmentLanguage\python\Python38\lib\site-packages\taos\cinterface.py:329: ProgrammingError

============================== 1 failed in 0.28s ==============================

Process finished with exit code 1

@jiabaoyu114 jiabaoyu114 added the bug Something isn't working label Jul 4, 2024
@jiabaoyu114
Copy link
Author

jiabaoyu114 commented Jul 4, 2024

image
查询sql语句在cmd中,可以正常执行。

@jiabaoyu114
Copy link
Author

找到问题了,client info: 2.6.0.34 和 server info: 2.6.0.12 版本不一致所造成的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
1 participant