8000 Calling a sproc with an identifier that needs qualifying fails · Issue #1206 · PyMySQL/PyMySQL · GitHub
[go: up one dir, main page]

Skip to content

Calling a sproc with an identifier that needs qualifying fails #1206

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

Open
soshtolsus opened this issue Apr 11, 2025 · 0 comments · May be fixed by #1207
Open

Calling a sproc with an identifier that needs qualifying fails #1206

soshtolsus opened this issue Apr 11, 2025 · 0 comments · May be fixed by #1207

Comments

@soshtolsus
Copy link
soshtolsus commented Apr 11, 2025

Describe the bug
When calling a stored procedure via Cursor.callproc, if the identifier for that sproc requires qualification (e.g. backticks), the call fails, often returning an "access denied" error because the user doesn't have EXECUTE access to the non-existent sproc.

Additionally, when calling callproc with args, the call fails worse because of the server variable identifier composition.

To Reproduce
Complete steps to reproduce the behavior:

Schema:

CREATE DATABASE xxx;
CREATE TABLE xxx.yyy (
    id int not null auto_increment primary key
);
DELIMITER //
CREATE PROCEDURE xxx.`yyy.blah` (
  arg1
)
BEGIN
  select 1;
END//
DELIMITER ;

Code:

import pymysql

with pymysql.connect(...) as conn:
  with conn.cursor() as cursor:
    cursor.callproc('yyy.blah', args=(18,))

Expected behavior

  • xxx.\yyy.blah`` should be called
  • @_yyy.blah_0 should exist and be set to 18

Environment

  • OS: Linux (confirmed on Centos 7)
  • Server and version: MariaDB 10.1
  • PyMySQL version: 0.8.1 (but confirmed that the code in question is unchanged in master)
@soshtolsus soshtolsus linked a pull request Apr 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0