Skip to content

Commit

Permalink
Fix previous commit for mysql and others
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Apr 15, 2024
1 parent 369b155 commit 2b4a75c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/ejabberd_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -168,26 +168,28 @@ end_per_group(redis, _Config) ->
end_per_group(mysql, Config) ->
Query = "SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 'mqtt_pub';",
case catch ejabberd_sql:sql_query(?MYSQL_VHOST, [Query]) of
{selected, [1]} ->
{selected, _, [[<<"0">>]]} ->
ok;
{selected, _, [[<<"1">>]]} ->
clear_sql_tables(mysql, Config);
Other ->
ct:fail({failed_to_check_table_existence, mysql, Other})
end,
ok;
end_per_group(mssql, Config) ->
Query = "SELECT * FROM sys.tables WHERE name = 'mqtt_pub'",
case catch ejabberd_sql:sql_query(?MYSQL_VHOST, [Query]) of
case catch ejabberd_sql:sql_query(?MSSQL_VHOST, [Query]) of
{selected, [t]} ->
clear_sql_tables(mysql, Config);
clear_sql_tables(mssql, Config);
Other ->
ct:fail({failed_to_check_table_existence, mssql, Other})
end,
ok;
end_per_group(pgsql, Config) ->
Query = "SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = 'mqtt_pub');",
case catch ejabberd_sql:sql_query(?MYSQL_VHOST, [Query]) of
case catch ejabberd_sql:sql_query(?PGSQL_VHOST, [Query]) of
{selected, [t]} ->
clear_sql_tables(mysql, Config);
clear_sql_tables(pgsql, Config);
Other ->
ct:fail({failed_to_check_table_existence, pgsql, Other})
end,
Expand Down

0 comments on commit 2b4a75c

Please sign in to comment.