dolthub / dolthub/dolt

Match MySQL's handling of nested subroutine definitions.

Open
#8,053 0 comments 0 reactions 0 assignees View on GitHub
correctness enhancement
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 8h
Merged PRs (30d)
120

Description

A "subroutine" refers to any statement or block of statements that is defined but may not be immediately executed. MySQL has six types of subroutines:

- `CREATE PROCEDURE`
- `CREATE FUNCTION`
- `CREATE TRIGGER`
- `CREATE EVENT`
- `CREATE TABLE AS`
- `CREATE VIEW AS`

Dolt has all of these except functions.

Nesting these constructs is allowed in some cases but not others. Prior to fixing https://github.com/dolthub/dolt/issues/8028, attempting to nest these constructs caused a panic. Now, while there is no panic, our behavior does not necessarily match MySQL

- In cases where both Dolt and MySQL return an error, Dolt's error message should match MySQL.

- In cases where Dolt returns an error but MySQL doesn't, we should match MySQL's behavior.

- In cases where MySQL returns an error but Dolt doesn't, we should either match MySQL, or add additional tests to verify that our behavior is sensible.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the nested CREATE PROCEDURE, CREATE TRIGGER, CREATE EVENT, CREATE TABLE AS, and CREATE VIEW AS cases in Dolt and MySQL, comparing errors and successful behavior. Done means Dolt matches MySQL where possible, with tests documenting any intentional differences.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, mysql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.