-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add io wait callback for blockin io operations. #23
Closed
GeorgyKirichenko
wants to merge
1
commit into
mariadb-corporation:master
from
GeorgyKirichenko:master
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,6 +208,7 @@ extern const char *SQLSTATE_UNKNOWN; | |
/* MariaDB specific */ | ||
MYSQL_PROGRESS_CALLBACK=5999, | ||
MYSQL_OPT_NONBLOCK, | ||
MYSQL_OPT_IO_WAIT, | ||
/* MariaDB Connector/C specific */ | ||
MYSQL_DATABASE_DRIVER=7000, | ||
MARIADB_OPT_SSL_FP, /* deprecated, use MARIADB_OPT_TLS_PEER_FP instead */ | ||
|
@@ -316,6 +317,7 @@ struct st_mysql_options { | |
int (*local_infile_error)(void *, char *, unsigned int); | ||
void *local_infile_userdata; | ||
struct st_mysql_options_extension *extension; | ||
int (*io_wait)(my_socket handle, my_bool is_read, int timeout); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be added to mysql->options.extension to avoid ABI breakage. |
||
}; | ||
|
||
typedef struct st_mysql { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2716,6 +2716,9 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...) | |
} | ||
mysql->options.extension->async_context= ctxt; | ||
break; | ||
case MYSQL_OPT_IO_WAIT: | ||
mysql->options.io_wait = (int(*)(my_socket, bool, int))arg1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. callback should be registered in mysql->options.extension->io_wait |
||
break; | ||
case MYSQL_OPT_MAX_ALLOWED_PACKET: | ||
if (mysql) | ||
mysql->options.max_allowed_packet= (unsigned long)(*(size_t *)arg1); | ||
|
@@ -3035,6 +3038,9 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...) | |
case MYSQL_OPT_NONBLOCK: | ||
*((my_bool *)arg)= test(mysql->options.extension && mysql->options.extension->async_context); | ||
break; | ||
case MYSQL_OPT_IO_WAIT: | ||
*((int(**)(my_socket, my_bool, int))arg) = mysql->options.io_wait; | ||
break; | ||
case MYSQL_OPT_SSL_ENFORCE: | ||
*((my_bool *)arg)= mysql->options.use_ssl; | ||
break; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New options (which are not supported by MySQL server should be prefixed with MariaDB and should be added to the end of enumeration.