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

feature: rm useless code in sql_optimizer.cc #1542

Closed
hustjieke opened this issue Apr 10, 2023 · 1 comment · Fixed by #1646
Closed

feature: rm useless code in sql_optimizer.cc #1542

hustjieke opened this issue Apr 10, 2023 · 1 comment · Fixed by #1646
Labels
A-feature feature with good idea prio: normal Medium priority

Comments

@hustjieke
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

As we support delete & update now, the code next should be deleted.
Introduced on pr: ea99be9

    /*
      The primary key of the tianmu engine does not support delete and update statements.
      The following codes can be deleted after subsequent support
    */
    TABLE *const table= join_tab->table();
    bool tianmu_engine = table->s->db_type() ? table->s->db_type()->db_type == DB_TYPE_TIANMU: false;
    enum_sql_command sqlCommand = thd->lex->sql_command;
    bool tianmuDeleteOrUpdate = (tianmu_engine && (sqlCommand == SQLCOM_DELETE ||
                                          sqlCommand == SQLCOM_DELETE_MULTI ||
                                          sqlCommand == SQLCOM_UPDATE ||
                                          sqlCommand == SQLCOM_UPDATE_MULTI));

    if (!tianmuDeleteOrUpdate && update_ref_and_keys(thd, &keyuse_array, join_tab, tables, where_cond,
                            cond_equal, ~select_lex->outer_join, select_lex,
                            &sargables))

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@hustjieke hustjieke added A-feature feature with good idea prio: normal Medium priority labels Apr 10, 2023
@hustjieke hustjieke added this to the stonedb_5.7_v1.0.4 milestone Apr 10, 2023
@konghaiya
Copy link
Collaborator

These codes are intended to limit the use of primary keys, as the primary key functionality of the Tianmu engine is not comprehensive.
These codes can only be deleted after the functionality of the primary key is fully supported

@mergify mergify bot closed this as completed in #1646 May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-feature feature with good idea prio: normal Medium priority
Projects
Development

Successfully merging a pull request may close this issue.

2 participants