Skip to content

Commit 83208c2

Browse files
committed
IGNITE-12975: SQL query do not create cache
This closes #12
1 parent d7d6d35 commit 83208c2

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

pyignite/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ def generate_result(value):
586586

587587
conn = self.random_node
588588

589-
schema = self.get_or_create_cache(schema)
589+
schema = self.get_cache(schema)
590590
result = sql_fields(
591591
conn, schema.cache_id, query_str,
592592
page_size, query_args, schema.name,

tests/test_binary.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
def test_sql_read_as_binary(client):
6666

67+
client.get_or_create_cache(scheme_name)
6768
client.sql(drop_query)
6869

6970
# create table

tests/test_sql.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
import pytest
17+
1618
from pyignite.api import (
1719
sql_fields, sql_fields_cursor_get_page,
18-
cache_get_or_create, sql, sql_cursor_get_page,
20+
sql, sql_cursor_get_page,
1921
cache_get_configuration,
2022
)
2123
from pyignite.datatypes.prop_codes import *
24+
from pyignite.exceptions import SQLError
2225
from pyignite.utils import entity_id, unwrap_binary
2326

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

188191
client.sql(drop_query)
192+
193+
194+
def test_sql_not_create_cache(client):
195+
with pytest.raises(SQLError, match=r".*Cache does not exist.*"):
196+
client.sql(schema='IS_NOT_EXISTING', query_str='select * from IsNotExisting')

0 commit comments

Comments
 (0)