Replies: 1 comment
-
step 1. connect to arana and set @A |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Ref : https://dev.mysql.com/doc/refman/8.0/en/sql-prepared-statements.html
分析
a. prepare
a1. prepare xx from 'str'
a2. prepare xx from var (其中 str 可能为字符串,也可能变量var,可能为逻辑库、表名称等 )
b. execute
c. deallocate
d. set ( 同步变量到 mysql 时没指定库 code)
问题:
shards 如何处理?比如变量设置一个逻辑表,什么时候解析逻辑表到物理表的关系?
[x] a. 设置 var 的时候解析;(1. 不一定是和 prepare 配合使用;2. 其他用法时还需要反解析)
[✓] b.execute 时解析,即真正使用的时候才解析;
当 prepare 的 sql 如下时,是所有的表都需要循环执行一次?还是效仿 set 仅设置一次即可?
Beta Was this translation helpful? Give feedback.
All reactions