From 007c95123d50b93a2ecc7b5078ae4040dbfa7936 Mon Sep 17 00:00:00 2001 From: vkatsuba Date: Thu, 24 Dec 2020 12:45:34 +0200 Subject: [PATCH] Mnesia migration: CT - for debug failed tests ONLY --- .travis.yml | 30 ++-- big_tests/default.spec | 143 +++++++++--------- big_tests/tests/mnesia_migration_SUITE.erl | 56 +++---- .../service_admin_extra_migration.erl | 21 ++- 4 files changed, 128 insertions(+), 122 deletions(-) diff --git a/.travis.yml b/.travis.yml index f218e38df15..bbb0f20fa1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,13 +90,13 @@ env: - PRESET=small_tests RUN_SMALL_TESTS=true SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 - PRESET=internal_mnesia DB="mnesia minio" REL_CONFIG="with-all" TLS_DIST=true - PRESET=odbc_mssql_mnesia DB=mssql REL_CONFIG="with-odbc" - - PRESET=mysql_redis DB=mysql REL_CONFIG="with-mysql with-redis with-amqp_client" - - PRESET=riak_mnesia DB=riak REL_CONFIG="with-riak" - - PRESET=ldap_mnesia DB=mnesia REL_CONFIG="with-none" - - PRESET=elasticsearch_and_cassandra_mnesia DB="elasticsearch cassandra" - REL_CONFIG="with-elasticsearch with-cassandra" TESTSPEC=mam.spec - ELASTICSEARCH_VERSION=5.6.9 CASSANDRA_VERSION=3.9 - - PRESET=dialyzer_only SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 SKIP_COV=1 SKIP_REPORT_UPLOAD=1 + #- PRESET=mysql_redis DB=mysql REL_CONFIG="with-mysql with-redis with-amqp_client" + #- PRESET=riak_mnesia DB=riak REL_CONFIG="with-riak" + #- PRESET=ldap_mnesia DB=mnesia REL_CONFIG="with-none" + #- PRESET=elasticsearch_and_cassandra_mnesia DB="elasticsearch cassandra" + # REL_CONFIG="with-elasticsearch with-cassandra" TESTSPEC=mam.spec + # ELASTICSEARCH_VERSION=5.6.9 CASSANDRA_VERSION=3.9 + #- PRESET=dialyzer_only SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 SKIP_COV=1 SKIP_REPORT_UPLOAD=1 # In case you want to test with another ODBC driver, uncomment this # - PRESET=odbc_pgsql_mnesia DB=pgsql REL_CONFIG=with-odbc @@ -105,14 +105,14 @@ matrix: include: - otp_release: 22.3 env: PRESET=pgsql_mnesia DB=pgsql REL_CONFIG="with-pgsql" RUN_SMALL_TESTS=true - - language: generic - env: PRESET=pkg pkg_PLATFORM=centos_7 - SKIP_COMPILE=1 SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 ESL_ERLANG_PKG_VER=22.1.8-2 - SKIP_COV=1 SKIP_REPORT_UPLOAD=1 - - language: generic - env: PRESET=pkg pkg_PLATFORM=debian_stretch ESL_ERLANG_PKG_VER=22.1.8-1 - SKIP_COMPILE=1 SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 - SKIP_COV=1 SKIP_REPORT_UPLOAD=1 + #- language: generic + # env: PRESET=pkg pkg_PLATFORM=centos_7 + # SKIP_COMPILE=1 SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 ESL_ERLANG_PKG_VER=22.1.8-2 + # SKIP_COV=1 SKIP_REPORT_UPLOAD=1 + #- language: generic + # env: PRESET=pkg pkg_PLATFORM=debian_stretch ESL_ERLANG_PKG_VER=22.1.8-1 + # SKIP_COMPILE=1 SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 + # SKIP_COV=1 SKIP_REPORT_UPLOAD=1 notifications: webhooks: diff --git a/big_tests/default.spec b/big_tests/default.spec index 3605aed8ec2..725211729cb 100644 --- a/big_tests/default.spec +++ b/big_tests/default.spec @@ -11,79 +11,80 @@ %% do not remove below SUITE if testing mongoose {suites, "tests", mongoose_sanity_checks_SUITE}. -{suites, "tests", acc_e2e_SUITE}. -{suites, "tests", accounts_SUITE}. -{suites, "tests", adhoc_SUITE}. -{suites, "tests", amp_big_SUITE}. -{suites, "tests", anonymous_SUITE}. -{suites, "tests", bosh_SUITE}. -{suites, "tests", carboncopy_SUITE}. -{suites, "tests", cluster_commands_SUITE}. -{suites, "tests", component_SUITE}. -{suites, "tests", conf_reload_SUITE}. -{suites, "tests", config_format_SUITE}. -{suites, "tests", connect_SUITE}. -{suites, "tests", disco_and_caps_SUITE}. -{suites, "tests", ejabberdctl_SUITE}. -{suites, "tests", extdisco_SUITE}. -{suites, "tests", gdpr_SUITE}. -{suites, "tests", inbox_SUITE}. -{suites, "tests", jingle_SUITE}. -{suites, "tests", last_SUITE}. -{suites, "tests", login_SUITE}. -{suites, "tests", mam_SUITE}. -{suites, "tests", metrics_api_SUITE}. -{suites, "tests", metrics_c2s_SUITE}. -{suites, "tests", metrics_register_SUITE}. -{suites, "tests", metrics_roster_SUITE}. -{suites, "tests", metrics_session_SUITE}. -{suites, "tests", mod_aws_sns_SUITE}. -{suites, "tests", mod_blocking_SUITE}. -{suites, "tests", mod_event_pusher_rabbit_SUITE}. -{suites, "tests", mod_event_pusher_http_SUITE}. -{suites, "tests", mod_global_distrib_SUITE}. -{suites, "tests", mod_http_upload_SUITE}. -{suites, "tests", mod_ping_SUITE}. -{suites, "tests", mod_time_SUITE}. -{suites, "tests", mod_version_SUITE}. -{suites, "tests", mongoose_cassandra_SUITE}. -{suites, "tests", mongoose_elasticsearch_SUITE}. -{suites, "tests", muc_SUITE}. -{suites, "tests", muc_http_api_SUITE}. -{suites, "tests", muc_light_SUITE}. -{suites, "tests", muc_light_http_api_SUITE}. -{suites, "tests", muc_light_legacy_SUITE}. -{suites, "tests", oauth_SUITE}. -{suites, "tests", offline_SUITE}. -{suites, "tests", pep_SUITE}. -{suites, "tests", persistent_cluster_id_SUITE}. -{suites, "tests", presence_SUITE}. -{suites, "tests", privacy_SUITE}. -{suites, "tests", private_SUITE}. -{suites, "tests", pubsub_SUITE}. -{suites, "tests", pubsub_s2s_SUITE}. -{suites, "tests", push_SUITE}. -{suites, "tests", push_http_SUITE}. -{suites, "tests", push_integration_SUITE}. -{suites, "tests", push_pubsub_SUITE}. -{suites, "tests", race_conditions_SUITE}. -{suites, "tests", rdbms_SUITE}. -{suites, "tests", rest_SUITE}. -{suites, "tests", rest_client_SUITE}. -{suites, "tests", s2s_SUITE}. -{suites, "tests", sasl_SUITE}. -{suites, "tests", sasl_external_SUITE}. -{suites, "tests", service_mongoose_system_metrics_SUITE}. -{suites, "tests", shared_roster_SUITE}. -{suites, "tests", sic_SUITE}. -{suites, "tests", sm_SUITE}. -{suites, "tests", users_api_SUITE}. -{suites, "tests", vcard_SUITE}. -{suites, "tests", vcard_simple_SUITE}. -{suites, "tests", websockets_SUITE}. -{suites, "tests", xep_0352_csi_SUITE}. {suites, "tests", mnesia_migration_SUITE}. +%{suites, "tests", acc_e2e_SUITE}. +%{suites, "tests", accounts_SUITE}. +%{suites, "tests", adhoc_SUITE}. +%{suites, "tests", amp_big_SUITE}. +%{suites, "tests", anonymous_SUITE}. +%{suites, "tests", bosh_SUITE}. +%{suites, "tests", carboncopy_SUITE}. +%{suites, "tests", cluster_commands_SUITE}. +%{suites, "tests", component_SUITE}. +%{suites, "tests", conf_reload_SUITE}. +%{suites, "tests", config_format_SUITE}. +%{suites, "tests", connect_SUITE}. +%{suites, "tests", disco_and_caps_SUITE}. +%{suites, "tests", ejabberdctl_SUITE}. +%{suites, "tests", extdisco_SUITE}. +%{suites, "tests", gdpr_SUITE}. +%{suites, "tests", inbox_SUITE}. +%{suites, "tests", jingle_SUITE}. +%{suites, "tests", last_SUITE}. +%{suites, "tests", login_SUITE}. +%{suites, "tests", mam_SUITE}. +%{suites, "tests", metrics_api_SUITE}. +%{suites, "tests", metrics_c2s_SUITE}. +%{suites, "tests", metrics_register_SUITE}. +%{suites, "tests", metrics_roster_SUITE}. +%{suites, "tests", metrics_session_SUITE}. +%{suites, "tests", mod_aws_sns_SUITE}. +%{suites, "tests", mod_blocking_SUITE}. +%{suites, "tests", mod_event_pusher_rabbit_SUITE}. +%{suites, "tests", mod_event_pusher_http_SUITE}. +%{suites, "tests", mod_global_distrib_SUITE}. +%{suites, "tests", mod_http_upload_SUITE}. +%{suites, "tests", mod_ping_SUITE}. +%{suites, "tests", mod_time_SUITE}. +%{suites, "tests", mod_version_SUITE}. +%{suites, "tests", mongoose_cassandra_SUITE}. +%{suites, "tests", mongoose_elasticsearch_SUITE}. +%{suites, "tests", muc_SUITE}. +%{suites, "tests", muc_http_api_SUITE}. +%{suites, "tests", muc_light_SUITE}. +%{suites, "tests", muc_light_http_api_SUITE}. +%{suites, "tests", muc_light_legacy_SUITE}. +%{suites, "tests", oauth_SUITE}. +%{suites, "tests", offline_SUITE}. +%{suites, "tests", pep_SUITE}. +%{suites, "tests", persistent_cluster_id_SUITE}. +%{suites, "tests", presence_SUITE}. +%{suites, "tests", privacy_SUITE}. +%{suites, "tests", private_SUITE}. +%{suites, "tests", pubsub_SUITE}. +%{suites, "tests", pubsub_s2s_SUITE}. +%{suites, "tests", push_SUITE}. +%{suites, "tests", push_http_SUITE}. +%{suites, "tests", push_integration_SUITE}. +%{suites, "tests", push_pubsub_SUITE}. +%{suites, "tests", race_conditions_SUITE}. +%{suites, "tests", rdbms_SUITE}. +%{suites, "tests", rest_SUITE}. +%{suites, "tests", rest_client_SUITE}. +%{suites, "tests", s2s_SUITE}. +%{suites, "tests", sasl_SUITE}. +%{suites, "tests", sasl_external_SUITE}. +%{suites, "tests", service_mongoose_system_metrics_SUITE}. +%{suites, "tests", shared_roster_SUITE}. +%{suites, "tests", sm_SUITE}. +%{suites, "tests", sic_SUITE}. +%{suites, "tests", users_api_SUITE}. +%{suites, "tests", vcard_SUITE}. +%{suites, "tests", vcard_simple_SUITE}. +%{suites, "tests", websockets_SUITE}. +%{suites, "tests", xep_0352_csi_SUITE}. + {config, ["test.config"]}. {logdir, "ct_report"}. diff --git a/big_tests/tests/mnesia_migration_SUITE.erl b/big_tests/tests/mnesia_migration_SUITE.erl index bcf8a5fbea1..53b52c61058 100644 --- a/big_tests/tests/mnesia_migration_SUITE.erl +++ b/big_tests/tests/mnesia_migration_SUITE.erl @@ -113,14 +113,14 @@ end_per_testcase(CaseName, Config) -> %%% ================================================================== migrate_pubsub_nodes(_Config) -> - Nidx = create_migration_node(), + _ = create_migration_node(), {ok, _} = ?RPC_MIGRATE(<<"pubsub_nodes">>), SqlData = #{table => <<"pubsub_nodes">>, where => <<"name='", ?NODE_NAME/binary, "'">>}, - case sql_to_rdbms(SqlData#{act => <<"SELECT">>, column => <<"nidx">>}) of - {selected, [{Nidx}]} -> + case sql_to_rdbms(SqlData#{act => <<"SELECT">>, column => <<"name">>}) of + {selected, [{?NODE_NAME}]} -> {updated, 1} = sql_to_rdbms(SqlData#{act => <<"DELETE">>, column => <<"">>}), _ = clear_tables(), - ct:comment("Migration of 'pubsub_nodes' is successful for Nidx: ~p", [Nidx]); + ct:comment("Migration of 'pubsub_nodes' is successful for 'name': ~p", [?NODE_NAME]); Any -> ct:fail("Unexpected result of 'pubsub_nodes' migration ~p~n", [Any]) end. @@ -133,12 +133,12 @@ migrate_pubsub_subscriptions(_Config) -> Nidx = create_migration_node(), ok = mongoose_helper:successful_rpc(mod_pubsub_db_mnesia, transaction, [#{name => add_subscription, args => [Nidx, ?JID, 'subscribed', <<"0000-0000-0000000">>, []]}]), {ok, _} = ?RPC_MIGRATE(<<"pubsub_subscriptions">>), - SqlData = #{table => <<"pubsub_subscriptions">>, where => <<"nidx=", (list_to_binary(integer_to_list(Nidx)))/binary>>}, - case sql_to_rdbms(SqlData#{act => <<"SELECT">>, column => <<"nidx">>}) of - {selected, [{Nidx}]} -> + SqlData = #{table => <<"pubsub_subscriptions">>, where => <<"luser='", ?USERNAME/binary, "'">>}, + case sql_to_rdbms(SqlData#{act => <<"SELECT">>, column => <<"luser">>}) of + {selected, [{?USERNAME}]} -> {updated, 1} = sql_to_rdbms(SqlData#{act => <<"DELETE">>, column => <<"">>}), _ = clear_tables(), - ct:comment("Migration of 'pubsub_subscriptions' is successful for Nidx: ~p", [Nidx]); + ct:comment("Migration of 'pubsub_subscriptions' is successful for 'luser': ~p", [?USERNAME]); Any -> ct:fail("Unexpected result of 'pubsub_subscriptions' migration ~p~n", [Any]) end. @@ -148,14 +148,14 @@ migrate_pubsub_subscriptions(_Config) -> %%% ================================================================== migrate_pubsub_affiliations(_Config) -> - Nidx = create_migration_node(), + _ = create_migration_node(), {ok, _} = ?RPC_MIGRATE(<<"pubsub_affiliations">>), - SqlData = #{table => <<"pubsub_affiliations">>, where => <<"nidx=", (list_to_binary(integer_to_list(Nidx)))/binary>>}, - case sql_to_rdbms(SqlData#{act => <<"SELECT">>, column => <<"nidx">>}) of - {selected, [{Nidx}]} -> + SqlData = #{table => <<"pubsub_affiliations">>, where => <<"luser='", ?USERNAME/binary, "'">>}, + case sql_to_rdbms(SqlData#{act => <<"SELECT">>, column => <<"luser">>}) of + {selected, [{?USERNAME}]} -> {updated, 1} = sql_to_rdbms(SqlData#{act => <<"DELETE">>, column => <<"">>}), _ = clear_tables(), - ct:comment("Migration of 'pubsub_affiliations' is successful for Nidx: ~p", [Nidx]); + ct:comment("Migration of 'pubsub_affiliations' is successful for 'pubsub_affiliations': ~p", [?USERNAME]); Any -> ct:fail("Unexpected result of 'pubsub_affiliations' migration ~p~n", [Any]) end. @@ -168,12 +168,12 @@ migrate_pubsub_items(_Config) -> Nidx = create_migration_node(), ok = mongoose_helper:successful_rpc(mod_pubsub_db_mnesia, transaction, [#{name => add_item, args => [Nidx, ?JID, ?BASE_ITEM(Nidx)]}]), {ok, _} = ?RPC_MIGRATE(<<"pubsub_items">>), - SqlData = #{table => <<"pubsub_items">>, where => <<"nidx=", (list_to_binary(integer_to_list(Nidx)))/binary>>}, - case sql_to_rdbms(SqlData#{act => <<"SELECT">>, column => <<"nidx">>}) of - {selected, [{Nidx}]} -> + SqlData = #{table => <<"pubsub_items">>, where => <<"created_luser='", ?USERNAME/binary, "'">>}, + case sql_to_rdbms(SqlData#{act => <<"SELECT">>, column => <<"created_luser">>}) of + {selected, [{?USERNAME}]} -> {updated, 1} = sql_to_rdbms(SqlData#{act => <<"DELETE">>, column => <<"">>}), _ = clear_tables(), - ct:comment("Migration of 'pubsub_items' is successful for Nidx: ~p", [Nidx]); + ct:comment("Migration of 'pubsub_items' is successful for 'created_luser': ~p", [?USERNAME]); Any -> ct:fail("Unexpected result of 'pubsub_items' migration ~p~n", [Any]) end. @@ -216,7 +216,7 @@ migrate_vcard_search(_Config) -> %%% Test case for migrate vcard %%% ================================================================== -migrate_vcard(Config) -> +migrate_vcard(_Config) -> ok = set_vcard(), {ok, _} = ?RPC_MIGRATE(<<"vcard">>), SqlData = #{table => <<"vcard">>, where => <<"username='", ?USERNAME/binary, "'">>}, @@ -233,7 +233,7 @@ migrate_vcard(Config) -> %%% Test case for migrate event_pusher_push_subscription %%% ================================================================== -migrate_event_pusher_push_subscription(Config) -> +migrate_event_pusher_push_subscription(_Config) -> PubsubNode = <<"migration_pub_sub_node">>, ok = mongoose_helper:successful_rpc(mod_event_pusher_push_mnesia, enable, [?JID, ?JID, PubsubNode, [{<<"name">>, <<"value">>}]]), {ok, _} = ?RPC_MIGRATE(<<"event_pusher_push_subscription">>), @@ -251,7 +251,7 @@ migrate_event_pusher_push_subscription(Config) -> %%% Test case for migrate rosterusers @TODO %%% ================================================================== -migrate_rosterusers(Config) -> +migrate_rosterusers(_Config) -> ?RPC_MIGRATE(<<"rosterusers">>), ct:comment("TEST CASE ~p", [?FUNCTION_NAME]). @@ -259,7 +259,7 @@ migrate_rosterusers(Config) -> %%% Test case for migrate roster_version @TODO %%% ================================================================== -migrate_roster_version(Config) -> +migrate_roster_version(_Config) -> ?RPC_MIGRATE(<<"roster_version">>), ct:comment("TEST CASE ~p", [?FUNCTION_NAME]). @@ -267,7 +267,7 @@ migrate_roster_version(Config) -> %%% Test case for migrate rostergroups @TODO %%% ================================================================== -migrate_rostergroups(Config) -> +migrate_rostergroups(_Config) -> ?RPC_MIGRATE(<<"rostergroups">>), ct:comment("TEST CASE ~p", [?FUNCTION_NAME]). @@ -275,7 +275,7 @@ migrate_rostergroups(Config) -> %%% Test case for migrate last @TODO %%% ================================================================== -migrate_last(Config) -> +migrate_last(_Config) -> ?RPC_MIGRATE(<<"last">>), ct:comment("TEST CASE ~p", [?FUNCTION_NAME]). @@ -283,7 +283,7 @@ migrate_last(Config) -> %%% Test case for migrate private_storage @TODO %%% ================================================================== -migrate_private_storage(Config) -> +migrate_private_storage(_Config) -> ?RPC_MIGRATE(<<"private_storage">>), ct:comment("TEST CASE ~p", [?FUNCTION_NAME]). @@ -291,7 +291,7 @@ migrate_private_storage(Config) -> %%% Test case for migrate offline_message @TODO %%% ================================================================== -migrate_offline_message(Config) -> +migrate_offline_message(_Config) -> ?RPC_MIGRATE(<<"offline_message">>), ct:comment("TEST CASE ~p", [?FUNCTION_NAME]). @@ -299,7 +299,7 @@ migrate_offline_message(Config) -> %%% Test case for migrate muc_light_rooms @TODO %%% ================================================================== -migrate_muc_light_rooms(Config) -> +migrate_muc_light_rooms(_Config) -> ?RPC_MIGRATE(<<"muc_light_rooms">>), ct:comment("TEST CASE ~p", [?FUNCTION_NAME]). @@ -307,7 +307,7 @@ migrate_muc_light_rooms(Config) -> %%% Test case for migrate all @TODO %%% ================================================================== -migrate_all(Config) -> +migrate_all(_Config) -> ?RPC_MIGRATE(<<"all">>), ct:comment("TEST CASE ~p", [?FUNCTION_NAME]). @@ -331,7 +331,7 @@ slow_rpc(M, F, A) -> sql_to_rdbms(#{act := Act, column := Column, table := Table, where := Where}) -> SelectQuery = <>, - SelectResult = sql_query(SelectQuery). + sql_query(SelectQuery). clear_tables() -> Tables = [pubsub_state, pubsub_item, pubsub_node, diff --git a/src/admin_extra/service_admin_extra_migration.erl b/src/admin_extra/service_admin_extra_migration.erl index f0fb1e0c48c..f46decdba5a 100644 --- a/src/admin_extra/service_admin_extra_migration.erl +++ b/src/admin_extra/service_admin_extra_migration.erl @@ -184,8 +184,8 @@ migrate_pubsub_nodes([H|_]) -> {Host, ID} = H#pubsub_node.nodeid, Owners = jiffy:encode([jid:to_binary(O) || O <- H#pubsub_node.owners]), Ops = jiffy:encode({H#pubsub_node.options}), - Cols = ["nidx", "p_key", "name", "type", "owners", "options"], - Vals = [H#pubsub_node.id, Host, ID, H#pubsub_node.type, Owners, Ops], + Cols = ["p_key", "name", "type", "owners", "options"], % "nidx" + Vals = [Host, ID, H#pubsub_node.type, Owners, Ops], % H#pubsub_node.id Q = ["INSERT INTO pubsub_nodes ", expand_sql_vals(Cols, Vals), ";"], case mongoose_rdbms:sql_query(?MYNAME, Q) of {error, Reason} -> @@ -271,15 +271,15 @@ migrate_pubsub_items([]) -> migrate_pubsub_items([H|_]) -> {IID, NodeIdx} = H#pubsub_item.itemid, {CTime, CJID} = H#pubsub_item.creation, - [Payload] = H#pubsub_item.payload, + Payload = H#pubsub_item.payload, CT = to_unixtime(CTime), JidBIn = jid:to_binary(CJID), JID = jid:from_binary(JidBIn), - XMLB = <<"", (exml:to_binary(Payload))/binary, "">>, + XMLB = exml:to_binary(#xmlel{name = <<"item">>, children = Payload}), % <<"", (exml:to_binary(Payload))/binary, "">> Cols = ["nidx", "itemid", "created_luser", "created_lserver", "created_at", "modified_luser", "modified_lserver", "modified_lresource", "modified_at", "payload"], Vals = [NodeIdx, IID, JID#jid.luser, JID#jid.lserver, CT, JID#jid.lserver, - JID#jid.lserver, JID#jid.lresource, CT, XMLB], + JID#jid.lserver, JID#jid.lresource, CT, {XMLB, escape_binary}], Q = ["INSERT INTO pubsub_items ", expand_sql_vals(Cols, Vals), ";"], case mongoose_rdbms:sql_query(?MYNAME, Q) of {error, Reason} -> @@ -558,10 +558,12 @@ migrate_muc_light_rooms([H|_]) -> {selected, [{null}]} -> 1; {selected, [{N}]} when is_integer(N) -> - N + 1 + N + 1; + {selected, [{N}]} when is_binary(N) -> + list_to_integer(binary_to_list(N)) + 1 end, - Cols = ["id", "luser", "lserver", "version"], - Vals = [ID, LUser, LServer, mod_muc_light_db_mnesia:get_room_version(H)], + Cols = ["luser", "lserver", "version"], % "id" + Vals = [LUser, LServer, mod_muc_light_db_mnesia:get_room_version(H)], % ID Q = ["INSERT INTO muc_light_rooms ", expand_sql_vals(Cols, Vals), ";"], case mongoose_rdbms:sql_query(?MYNAME, Q) of {error, Reason} -> @@ -689,6 +691,9 @@ join([H|T], Sep) -> %% ------------------------------------------------------------------- -spec escape(Data :: any()) -> Res :: binary() | list() | any(). +escape({Data, Escape}) -> + mongoose_rdbms_odbc:Escape(Data); + escape(Data) when is_integer(Data) -> integer_to_binary(Data);