Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyignite/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def generate_result(value):

conn = self.random_node

schema = self.get_or_create_cache(schema)
schema = self.get_cache(schema)
result = sql_fields(
conn, schema.cache_id, query_str,
page_size, query_args, schema.name,
Expand Down
1 change: 1 addition & 0 deletions tests/test_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

def test_sql_read_as_binary(client):

client.get_or_create_cache(scheme_name)
client.sql(drop_query)

# create table
Expand Down
10 changes: 9 additions & 1 deletion tests/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from pyignite.api import (
sql_fields, sql_fields_cursor_get_page,
cache_get_or_create, sql, sql_cursor_get_page,
sql, sql_cursor_get_page,
cache_get_configuration,
)
from pyignite.datatypes.prop_codes import *
from pyignite.exceptions import SQLError
from pyignite.utils import entity_id, unwrap_binary

initial_data = [
Expand Down Expand Up @@ -186,3 +189,8 @@ def test_long_multipage_query(client):
assert value == field_number * page[0]

client.sql(drop_query)


def test_sql_not_create_cache(client):
with pytest.raises(SQLError, match=r".*Cache does not exist.*"):
client.sql(schema='IS_NOT_EXISTING', query_str='select * from IsNotExisting')