Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix diagnose errors #42

Merged
merged 2 commits into from
Nov 25, 2022
Merged

Conversation

adriankumpf
Copy link
Contributor

@adriankumpf adriankumpf commented Nov 25, 2022

This fixes an error that occurred when running EctoPSQLExtras.diagnose/1 on Postgres 11.16:

10:49:56.541 [warning] Elixir.EctoPSQLExtras.DiagnoseLogic
** (MatchError) no match of right hand side value: :error
    (ecto_psql_extras 0.7.9) lib/ecto_psql_extras/diagnose_logic.ex:133: anonymous fn/1 in EctoPSQLExtras.DiagnoseLogic.null_indexes/1
    (elixir 1.14.2) lib/enum.ex:4197: Enum.filter_list/2
    (elixir 1.14.2) lib/enum.ex:4198: Enum.filter_list/2
    (ecto_psql_extras 0.7.9) lib/ecto_psql_extras/diagnose_logic.ex:132: EctoPSQLExtras.DiagnoseLogic.null_indexes/1
    (ecto_psql_extras 0.7.9) lib/ecto_psql_extras/diagnose_logic.ex:28: EctoPSQLExtras.DiagnoseLogic.run/1
    (ecto_psql_extras 0.7.9) lib/ecto_psql_extras.ex:121: EctoPSQLExtras.query/3
    (elixir 1.14.2) src/elixir.erl:309: anonymous fn/4 in :elixir.eval_external_handler/1
    (stdlib 4.1.1) erl_eval.erl:748: :erl_eval.do_apply/7

This was caused by EctoPSQLExtras.null_indexes/2 returning the following row:

[465344, "line_item_corrections_line_item_id_index", "1424 kB", true, "line_item_id", "    .07%", "972 bytes"]

Note the " .07%".

format_value/1 also failed because for some reason the tuple {string, :string} did not contain a string but an integer (465344).

@pawurb
Copy link
Owner

pawurb commented Nov 25, 2022

👍

@pawurb pawurb merged commit 2466307 into pawurb:master Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants