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

SQL Error in search_cluster_data_equality #1

Open
mabezi opened this issue Jun 29, 2023 · 0 comments
Open

SQL Error in search_cluster_data_equality #1

mabezi opened this issue Jun 29, 2023 · 0 comments
Assignees

Comments

@mabezi
Copy link

mabezi commented Jun 29, 2023

Checking the equality of the data fails because of an SQL error.

I think it's a bit related to a design decision in the code, so I'm not quite sure how to fix it.

SQL Error:

[Thu Jun 29 21:25:51 2023][Error][Kernel::System::Search::Admin::Reindexation::DataEqualitySet][363] ERROR:  null value in column "last_reindexation" of relation "search_cluster_data_equality" violates not-null constraint
DETAIL:  Failing row contains (61, 3, Article, 100.00, 2023-06-29 21:25:51, 2023-06-29 21:25:51, null)., SQL: '
                    INSERT INTO   search_cluster_data_equality (cluster_id, index_name, percentage, create_time, change_time)
                    VALUES        (?, ?, ?, '2023-06-29 21:25:51', '2023-06-29 21:25:51')
                '

It looks like the immediate cause is here:

if ( $IndexesToUpdateReindexTime{$Index} ) {
$ReindexationTimeUpdateSQL = ', last_reindexation';
$ReindexationTimeUpdateSQL2 = ', current_timestamp';
}

This query is made across the entire file.

Since the method evaluates to false, the field is not added to the SQL query, even though it is a required and non nullable field, according to the definition of the relation:

<Column Name="last_reindexation" Required="true" Type="DATE"/>

Is there a reasonable reason why this if-query is set as a condition for the field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants