Skip to content
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

Mysql 8.0 support #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Mysql 8.0 support #7

wants to merge 5 commits into from

Conversation

parthasai
Copy link

  1. Instead of using the unsupported my_bool variable in MySQL 8, have replaced it with int.
  2. In the install.sh and uninstall.sh scripts, modified the mechanism for extracting the plugin_dir. Previously, it was outputting 'plugin_dir ', which caused issues in the subsequent steps. Now, the extraction correctly provides only plugin directory path.
  3. Updated readme file to include installation of libmysqlclient-dev golang-go packages

@2rebi 2rebi linked an issue Jul 20, 2023 that may be closed by this pull request
@BuxtonCalvin
Copy link

Hello, I installed this patch/branch from parthasai on MariaDB Database client version: libmysql - mysqlnd 8.2.8 and all works great. The unpatched version did not work.

As you probably know, MySQL does not allow data returns in insert triggers. I can call a procedure holding the http function from a trigger, but the http function still returns values, that in turn are automatically passed back to the calling insert trigger, thereby causing the trigger to fail.

I was hoping you could add an option flag to the http functions that would disable any returns. This might do the trick to using these functions in a trigger.

@BuxtonCalvin
Copy link

There is another possibility that causes an insert trigger to fail. It may be that the mySQL engine sees the "SELECT http_get()" in the called procedure as a true SELECT statement that would by definition, return some type of value, and thereby cause the insert trigger to fail. I imagine this could only be solved by doing something like using "CALL http_get()" Is there any way to restructure the way the http_get function is used/initiated?

@BuxtonCalvin
Copy link

I also had to change the http.go file header to:

/*
#include <stdio.h>
#include <linux/types.h>
#include <linux/stat.h>
#include <stdlib.h>
#include <string.h>
#include <mysql/mysql.h>
#include <mysql/udf_registration_types.h>
*/

This seemed to do the trick to get it to compile.

@BuxtonCalvin
Copy link

One final comment. I was able to get this to work using the following statement: INSERT INTO logtable SET log= http_get(TRIM(@my_URL2)), msg1=@my_message, msg2=@my_params;

I basically created a logtable, and then directed the return of the http_get() function into the "log" field, with msg1 and msg2 fields capturing passed parameters from the originating trigger. You should note on your info page that you can use the INSERT command to make the function work in a trigger. Thanks for the plugin....

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 this pull request may close these issues.

It can't build on MySQL 8.X
2 participants