Skip to content

[PG DRIVER] When using sqlscript : Cannot invoke "java.util.List.iterator()" because "resultSet" is null #2117

@ExtReMLapin

Description

@ExtReMLapin

Version : #2114 but merged

Weird issue, when calling a query multiple times it SQLSCRIPT will get the error Cannot invoke "java.util.List.iterator()" because "resultSet" is null

import psycopg

db_string_test = 'TEST_DATABASE'

with psycopg.connect(user="root", password="rootroot",
                    host='localhost',
                    port='5432',
                    dbname=db_string_test,
                    sslmode='disable'
                    ) as connection:
    
    connection.autocommit = True

    with connection.cursor() as cursor:
        cursor.execute("create vertex type `IMAGE` if not exists;")
        for i in range(10):
            query = 'INSERT INTO `IMAGE` RETURN @rid;'
            cursor.execute(query)
            cursor.fetchall()
            
        print('ok for sql')
        
        for i in range(10):
            query = '{cypher}CREATE  (c:IMAGE) RETURN id(c)'
            cursor.execute(query)
            cursor.fetchall()
        print('ok for cypher')
        
        for i in range(10):
            query = '{sqlscript}INSERT INTO `IMAGE` RETURN @rid;'
            cursor.execute(query)
            cursor.fetchall()

        print('ok for sqlscript')

Edit : reduced issue to being related to sqlscript

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions