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

mysql /*!50001 CREATE ALGORITHM=UNDEFINED */ #75

Open
liuxiansong-ones opened this issue Aug 11, 2022 · 1 comment
Open

mysql /*!50001 CREATE ALGORITHM=UNDEFINED */ #75

liuxiansong-ones opened this issue Aug 11, 2022 · 1 comment

Comments

@liuxiansong-ones
Copy link

ERROR 3009 (HY000) at line [PXC-4500][ERR_PARSER] statement com.alibaba.polardbx.druid.sql.dialect.mysql.ast.statement.MySqlHintStatement not supported

/*!50001 CREATE ALGORITHM=UNDEFINED */

mysql的视图有三种类型:MERGE、TEMPTABLE、UNDEFINED。如果没有ALGORITHM子句,默认算法是UNDEFINED(未定义的)。算法会影响MySQL处理视图的方式。

(1)MERGE,会将引用视图的语句的文本与视图定义合并起来,使得视图定义的某一部分取代语句的对应部分。
(2)TEMPTABLE,视图的结果将被置于临时表中,然后使用它执行语句。
(3)UNDEFINED,MySQL将选择所要使用的算法。如果可能,它倾向于MERGE而不是TEMPTABLE,这是因为MERGE通常更有效,而且如果使用了临时表,视图是不可更新的。

@hustfxj
Copy link
Collaborator

hustfxj commented Aug 15, 2022

polardb-x 支持的视图目前只有MERGE这种形式,暂时还不支持UNDEFINED和TEMPTABLE,也不支持你说的这个hint呢?后面我们正在规划TEMPTABLE

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

No branches or pull requests

2 participants