matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Feature Request]: Support PREPARE statement

Open domingozhang opened this issue 3 years ago • 3 comments

Is there an existing issue for the same feature request?

  • [X] I have checked the existing issues.

Is your feature request related to a problem?

No response

Describe the feature you'd like

PREPARE stmt_name FROM preparable_stmt EXECUTE stmt_name [USING @var_name [, @var_name] ...] {DEALLOCATE | DROP} PREPARE stmt_name

mysql> PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse'; mysql> SET @a = 3; mysql> SET @b = 4; mysql> EXECUTE stmt1 USING @a, @b; +------------+ | hypotenuse | +------------+ | 5 | +------------+ mysql> DEALLOCATE PREPARE stmt1;

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

No response

Additional information

No response

domingozhang avatar Jul 04 '22 03:07 domingozhang

same as #3338.

ouyuanning avatar Jul 06 '22 00:07 ouyuanning

The response packet seems incorrect. Maybe the buffer of connection is handled incorrectly by the frontend.

The test code is: test.zip

image

sukki37 avatar Aug 06 '22 18:08 sukki37

The response packet seems incorrect. Maybe the buffer of connection is handled incorrectly by the frontend.

The test code is: test.zip

image

i had asked @daviszhen for help.

ouyuanning avatar Aug 08 '22 01:08 ouyuanning