From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C0E9B46970E for ; Fri, 27 Dec 2019 15:33:13 +0300 (MSK) From: imeevma@tarantool.org Date: Fri, 27 Dec 2019 15:33:12 +0300 Message-Id: <4f09686e246ae3507121bb66e07cbe1e5c94c608.1577449923.git.imeevma@gmail.com> Subject: [Tarantool-patches] [PATCH 1/1] sql: add another way to change SQL default engine List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org Due to the removal of the sql_default_engine pragma in 2.3.1, this patch adds another way to change this setting. --- https://github.com/tarantool/test-run/tree/imeevma/fix_sql_default_engine lib/tarantool_server.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/tarantool_server.py b/lib/tarantool_server.py index 6f71b5b..20a398e 100644 --- a/lib/tarantool_server.py +++ b/lib/tarantool_server.py @@ -145,12 +145,19 @@ class LuaTest(Test): return True engine = self.run_params['engine'] - command = "pragma sql_default_engine='{}'".format(engine) - result = self.send_command(command, ts, 'sql') - result = result.replace('\r\n', '\n') - if result != '---\n- row_count: 0\n...\n': - sys.stdout.write(result) - return False + + command_new = ("UPDATE \"_session_settings\" SET \"value\" = '{}' " + \ + "WHERE \"name\" = 'sql_default_engine'").format(engine) + result_new = self.send_command(command_new, ts, 'sql') + result_new = result_new.replace('\r\n', '\n') + + command_old = "pragma sql_default_engine='{}'".format(engine) + result_old = self.send_command(command_old, ts, 'sql') + result_old = result_old.replace('\r\n', '\n') + if result_new != '---\n- row_count: 1\n...\n': + if result_old != '---\n- row_count: 0\n...\n': + sys.stdout.write(result_old) + return False return True -- 2.7.4