-
Notifications
You must be signed in to change notification settings - Fork 548
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
Use bool
instead of my_bool
which has been removed since MySQL 8.0.1
#840
Conversation
Refer "Changes in MySQL 8.0.1 (2017-04-10, Development Milestone)" https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html > Incompatible Change: The mysql.h header file now requires a C++ or C99 compiler to compile. > The my_bool type is no longer used in MySQL source code. > Any third-party code that used this type to represent C boolean variables > should use the bool or int C type instead. (Bug #25597667)
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.
Thank you! I'll check on the other environments soon and get this merged.
@@ -1,5 +1,6 @@ | |||
#ifndef MYSQL2_RESULT_H | |||
#define MYSQL2_RESULT_H | |||
#include <stdbool.h> |
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.
Are there platforms these days that don't have stdbool.h available?
I'll check my Solaris and Windows environments. Off the cuff I think this will be a safe change.
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.
According to Bug #85131 Remove my_bool
- mysql.h now requires a C++ or C99 header to compile. (All supported platforms have C99 compilers, but some are C89 by default and need mode switches like --std=gnu99 or --std=c99.)
Then as long as it is one of the "supported platforms", C99 should be supported.
I'm not familiar with Windows or Solaris C Compiler but googled and found these links:
Supports these ISO C99 language features:
_Bool
B.2.73 -xc99[=o]
The -xc99 option controls compiler recognition of the implemented features from the C99
standard (ISO/IEC 9899:1999, Programming Language - C).
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.
I remember reading at one point that Ruby wants extensions to compile with C89? Is that still true?
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.
Sorry I did not find the information if Ruby requires C extensions compiled with C89.
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.
I found it! While it looks dated at this point, the assumptions are stated here: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Assumptions
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.
I also found that result.c
is already using uintptr_t
which is a C99 type from stdint.h
but we've not included stdint.h
ourselves, which is probably an error.
Hi, This is the pull request we were talking at RailsConf this morning. Would you mind taking a look at this pull request and have some comments if mysql2 gem can use C99 boolean feature? Thanks. |
Thanks! |
It may be the case that we need to use |
…MySQL 8.0.1 (brianmario#840)" This reverts commit 5889d04.
…MySQL 8.0.1 (brianmario#840)" This reverts commit 5889d04.
…MySQL 8.0.1 (brianmario#840)" This reverts commit 5889d04.
* master: (21 commits) Bump version to 0.5.0 README note that MariaDB 10.3 and Ruby 2.6 are supported Initialize params_enc variable to resolve a warning Travis CI add MariaDB 10.3 Travis CI add Ruby 2.6 Use a local scope to avoid leaking the temporary variable for bind_count Revert "Layout/IndentHeredoc" Bump RuboCop limits for spec file length Style nit fix for brianmario#943 Use a typedef my_bool to improve compatibility across MySQL versions Revert "Use `bool` instead of `my_bool` which has been removed since MySQL 8.0.1 (brianmario#840)" Style nit for brianmario#943 Expose the `mysql_set_server_option`: (brianmario#943) Update usage section of README.md (brianmario#939) Travis CI should run MySQL 5.5 tests on Trusty Looks like Windows Ruby 2.0 still has the buggy mkmf Use CLIENT_CONNECT_ATTRS flag to test the connection attributes feature README note that MariaDB 10.2 is supported Travis CI drop tests for MySQL 5.1 on Ubuntu Precise Fix Ruby 2.4 on Appveyor ...
This pull request addresses #838
Refer "Changes in MySQL 8.0.1 (2017-04-10, Development Milestone)"
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html