[MDEV-13529] Add class Sql_cmd_call Created: 2017-08-15  Updated: 2017-08-15  Resolved: 2017-08-15

Status: Closed
Project: MariaDB Server
Component/s: Parser, Stored routines
Fix Version/s: 10.3.1

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-10591 Oracle-style packages Closed

 Description   

This is a self-containing sub-task of MDEV-10591.
It's done separately, to reduce the patch size for MDEV-10591, to easier reviewing purposes.

Currently SQLCOM_CALL is handled in a huge piece of code in a switch in mysql_execute_command():

case SQLCOM_CALL:
  {
    // around 50 code lines
  }

We'll introduce a new class Sql_cmd_call and move this code to Sql_cmd_call::execute.

After this change, CALL statements will be handled in the same way with other statements using Sql_cmd based implementations:

  • ALTER TABLE
  • ALTER SEQUENCE
  • CHECK
  • OPTIMIZE
  • REPAIR
  • SIGNAL
  • RESIGNAL
  • GET DIAGNOSTICS
  • TRUNCATE

Reasoning:

  • MDEV-10591 will need more data (other than LEX::sphead) to execute the query: a pointer to Sp_handler will be needed, to distinguish between calls for standalone vs package procedures. Adding a new member to LEX is not a good idea.
  • All statements should eventually be refactored to use the Sql_cmd infrastructure anyway.

Generated at Thu Feb 08 08:06:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.