-
Notifications
You must be signed in to change notification settings - Fork 56
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
Pre_hook calling procedure breaks mysql connection #148
Labels
bug
Something isn't working
Comments
2 tasks
same issue here |
Model:
Macros:
Logs:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Transfer of dbt-labs/dbt-core#7757 opened by @Randyhall91.
Is this a new bug in dbt-core?
Current Behavior
The issue I'm having is, after creating a procedure in mysql and then calling it in a pre_hook the rest of the dbt file fails with the message " mysql adapter: MySQL error: MySQL Connection not available." The pre_hook runs successfully but anything after it resolves crashes with mysql connection failure.
Expected Behavior
I expect the pre_hook that uses a stored procedure to fire and the table to materialize as normal.
Steps To Reproduce
DELIMITER //
CREATE PROCEDURE test(
IN table_name VARCHAR(255),
)
BEGIN
select(table_name);
END//
DELIMITER ;
{{ config(
pre_hook=[
"use {{ var('schema') }};",
"call test('work_order_notes');"
],
)}}
Relevant log output
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
mysql: 1.1.0
I've tested this stored procedure in mysql workbench without any issues and this part of the code works fine but when added to the pre_hook in dbt the following table fails to be created.
Without the pre_hook the table generates with no issues.
The text was updated successfully, but these errors were encountered: