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 show subscriptions (#1.0-dev) #13599

Merged
merged 3 commits into from Dec 21, 2023
Merged

Conversation

YANGGMM
Copy link
Contributor

@YANGGMM YANGGMM commented Dec 19, 2023

fix show subscriptions

Approved by: @daviszhen, @iamlinjunhong, @heni02, @ouyuanning, @nnsgmsone

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #13542

What this PR does / why we need it:

fix show subscriptions

@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Dec 19, 2023
@mergify mergify bot requested a review from sukki37 December 19, 2023 08:09
@mergify mergify bot added the kind/bug Something isn't working label Dec 19, 2023
@YANGGMM YANGGMM closed this Dec 19, 2023
为execute 语句增加 prepare sql和参数值。

**Case1 : execute ... using ...**
execute 参数来自用户变量。
**输出格式: execute.... // prepare stmt1 from .... ; set var1 = val1 ; set var2 = val2 ;**

样例
```
> CREATE TABLE numbers(pk INTEGER PRIMARY KEY, ui BIGINT UNSIGNED, si BIGINT);
> INSERT INTO numbers VALUES (0, 0, -9223372036854775808), (1, 18446744073709551615, 9223372036854775807);
> SET @si_min = -9223372036854775808;
> SET @si_max = 9223372036854775807;
> PREPARE s2 FROM 'SELECT * FROM numbers WHERE si=?';
Query OK, 0 rows affected (0.00 sec)

> EXECUTE s2 USING @si_min;
+------+------+----------------------+
| pk   | ui   | si                   |
+------+------+----------------------+
|    0 |    0 | -9223372036854775808 |
+------+------+----------------------+
1 row in set (0.01 sec)

> EXECUTE s2 USING @si_max;
+------+----------------------+---------------------+
| pk   | ui                   | si                  |
+------+----------------------+---------------------+
|    1 | 18446744073709551615 | 9223372036854775807 |
+------+----------------------+---------------------+
1 row in set (0.01 sec)

statement_info中的结果:

mysql> select statement from system.statement_info where statement like '%EXECUTE%' \G
*************************** 1. row ***************************
statement: /* 1 queries */
EXECUTE s2 USING @si_min // SELECT * FROM numbers WHERE si=? ; SET @si_min = -9223372036854775808
*************************** 2. row ***************************
statement: /* 1 queries */
EXECUTE s2 USING @si_max // SELECT * FROM numbers WHERE si=? ; SET @si_max = 9223372036854775807

```

**Case2:  COM_STMT_EXECUTE**
这类 execute的参数是通过二进制传输的。
**输出格式 execute.... // prepare stmt1 from .... ; param0 ; param1 ...**

样例
```
statement_info中的结果:

execute __mo_stmt_id_1 // prepare __mo_stmt_id_1 from insert into mo_task.sys_cron_task (
task_metadata_id,
task_metadata_executor,
task_metadata_context,
task_metadata_option,
cron_expr,
next_time,
trigger_times,
create_at,
update_at
) values (?, ?, ?, ?, ?, ?, ?, ?, ?) ; ETLMergeTask ; 2 ;  ; {"Concurrency":1} ; 0 */5 * * * * ; 1702377600000 ; 0 ; 1702377597029 ; 1702377597029

```

Approved by: @qingxinhome, @heni02
@YANGGMM YANGGMM reopened this Dec 19, 2023
@matrix-meow matrix-meow added size/M Denotes a PR that changes [100,499] lines and removed size/S Denotes a PR that changes [10,99] lines labels Dec 19, 2023
@YANGGMM YANGGMM closed this Dec 20, 2023
@YANGGMM YANGGMM reopened this Dec 21, 2023
@mergify mergify bot merged commit c758fc0 into matrixorigin:1.0-dev Dec 21, 2023
17 of 18 checks passed
@YANGGMM YANGGMM deleted the fix-sub-1.0-dev branch January 4, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants