esl / MongooseIM

MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines.
Other
1.64k stars 422 forks source link

Fix type casting issues in PgSQL in mongoose_rdbms_timestamp #4183

Closed arcusfelis closed 5 months ago

arcusfelis commented 5 months ago

PgSQL version 13.9 would return a float in the old code.

Setup required version of PgSQL: DB=pgsql PGSQL_VERSION=13.9 ./tools/setup-db.sh

This PR addresses Error:

mongoose_rdbms_timestamp:select().
** exception error: no function clause matching mongoose_rdbms:result_to_integer(1701684792.0)

Proposed changes include:

mongoose-im commented 5 months ago

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 368 / Failed: 0 / User-skipped: 38 / Auto-skipped: 0


small_tests_25 / small_tests / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root / small


small_tests_26 / small_tests / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root / small


small_tests_26_arm64 / small_tests / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root / small


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4225 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4192 / Failed: 0 / User-skipped: 135 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 2268 / Failed: 0 / User-skipped: 847 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 2268 / Failed: 0 / User-skipped: 847 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4225 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4222 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4614 / Failed: 0 / User-skipped: 109 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4593 / Failed: 0 / User-skipped: 130 / Auto-skipped: 0


internal_mnesia_26 / internal_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 2408 / Failed: 0 / User-skipped: 707 / Auto-skipped: 0


pgsql_mnesia_26 / pgsql_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4614 / Failed: 0 / User-skipped: 109 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4273 / Failed: 0 / User-skipped: 110 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 29971c012824c8b2ad055cf7d593b94ef1b2ffcf Reports root/ big OK: 4609 / Failed: 2 / User-skipped: 112 / Auto-skipped: 0

graphql_muc_light_SUITE:admin_cli:admin_muc_light:admin_create_room_with_unprepped_id ```erlang {error, {#{what => invalid_response_code,expected_type => ok, response_code => {exit_status,1}}, [{graphql_helper,assert_response_code,2, [{file,"/home/circleci/project/big_tests/tests/graphql_helper.erl"}, {line,256}]}, {graphql_helper,get_ok_value,2, [{file,"/home/circleci/project/big_tests/tests/graphql_helper.erl"}, {line,239}]}, {graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1, [{file, "/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"}, {line,1156}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1302}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,1234}]}]}} ``` [Report log](https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4183/201620/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%405ea978a578ea.2023-12-04_10.28.43/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-04_10.34.49/graphql_muc_light_suite.admin_create_room_with_unprepped_id.40067.html)
graphql_muc_light_SUITE:domain_admin:domain_admin_muc_light:admin_create_room_with_unprepped_id ```erlang {error, {{badmatch,null}, [{graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1, [{file, "/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"}, {line,1155}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1302}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,1234}]}]}} ``` [Report log](https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4183/201620/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%405ea978a578ea.2023-12-04_10.28.43/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-04_10.34.49/graphql_muc_light_suite.admin_create_room_with_unprepped_id.31236.html)
codecov[bot] commented 5 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (44b57e6) 84.28% compared to head (29971c0) 34.42%.

Files Patch % Lines
src/rdbms/mongoose_rdbms_timestamp.erl 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4183 +/- ## =========================================== - Coverage 84.28% 34.42% -49.87% =========================================== Files 551 551 Lines 33467 33467 =========================================== - Hits 28208 11520 -16688 - Misses 5259 21947 +16688 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

arcusfelis commented 5 months ago

Duplicate, see https://github.com/esl/MongooseIM/pull/4182 instead