Skip to content

0.3.x latin1 to utf8 with mariadbclient support #29

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
wants to merge 72 commits into
base: 0.3.x_force_latin1_to_utf8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
14accdf
backporting table_exists? from Rails 3.1.x. Fixes #235
tenderlove Mar 28, 2012
1ab2f4b
Fix case where :limit is nil
jnevelson Jun 5, 2012
3105855
Backport of fix from rails/rails#5173
pixeltrix Aug 4, 2012
8896689
Merge pull request #283 from pixeltrix/fix-mediumtext-changing-to-lon…
brianmario Aug 4, 2012
8f528e2
Fix backport of table_exists? in 14accdf8d1
pixeltrix Aug 4, 2012
4d8222e
Merge pull request #284 from pixeltrix/fix-table-exists
brianmario Aug 4, 2012
653eea5
Change limit value to Arel default
jnevelson Aug 8, 2012
3793c5b
Merge pull request #270 from jnevelson/offset_patch
brianmario Aug 8, 2012
943a39b
bring in all the shit from master
brianmario Aug 8, 2012
efc1619
fix some tests from the testing config patch
brianmario Aug 8, 2012
f53c3e1
1.9.3 is preferred with rbenv too
brianmario Aug 8, 2012
e9d90a3
bump version for 0.2.19 beta 1 release
brianmario Aug 8, 2012
d9431c5
Mysql2::Client#more_results should be a predicate
brianmario Aug 9, 2012
aa17230
whitespace
brianmario Aug 9, 2012
a8aa5d3
bump version for 0.2.19b2
brianmario Aug 10, 2012
3bc6160
fix overflow in flags
brianmario Aug 22, 2012
7412b48
bump version for 0.2.19b3 release
brianmario Aug 22, 2012
7741ee1
allow setting of write_timeout
brianmario Aug 22, 2012
2c80cff
ensure connect_timeout is a positive integer
brianmario Aug 22, 2012
5f40693
whitespace
brianmario Aug 22, 2012
7dc9a48
bump version for 0.2.19b4 release
brianmario Aug 22, 2012
154d429
bring in latest from master
brianmario Oct 15, 2012
de03893
Merge branch 'master' into 0.2.x
brianmario Oct 15, 2012
78c6bba
Merge branch 'master' into 0.2.x
brianmario Oct 15, 2012
2aea76c
Merge branch 'master' into 0.2.x
brianmario Oct 16, 2012
1e9c231
Merge branch 'master' into 0.2.x
brianmario Oct 16, 2012
adc4864
Merge branch 'master' into 0.2.x
brianmario Oct 16, 2012
0bbf066
Merge branch 'master' into 0.2.x
brianmario Oct 16, 2012
11284ad
Merge branch 'master' into 0.2.x
brianmario Oct 23, 2012
b4d2a08
Merge branch 'master' into 0.2.x
brianmario Oct 30, 2012
b7d550f
Merge branch 'master' into 0.2.x
brianmario Oct 30, 2012
830b84e
Merge branch 'master' into 0.2.x
brianmario Nov 19, 2012
512cd33
Merge branch 'master' into 0.2.x
brianmario Nov 19, 2012
88c9d72
bump version for 0.2.19b5
brianmario Dec 14, 2012
712400a
active_record: Delegate BigDecimal quoting to abstract adapter.
dylanahsmith Feb 7, 2013
531bd3c
Merge pull request #351 from dylanahsmith/mysql-quote-numeric
sodabrew Feb 7, 2013
9039c06
bring in master
brianmario Feb 20, 2013
9627331
use local db config if avail
brianmario Feb 20, 2013
857c6a2
only use default limit value if offset is used without limit
brianmario Feb 21, 2013
445fa89
bump version to 0.2.19b6
brianmario Feb 21, 2013
f668ce4
symbolize keys sooner
May 9, 2012
e0ca4e6
bring in master
brianmario Jul 9, 2013
dd4b0f8
Merge pull request #357 from osheroff/symbolize_keys_sooner
brianmario Jul 9, 2013
901b308
Remove EM/fiber support from this gem
brianmario Jul 9, 2013
fd0f716
Merge branch 'master' into 0.2.x
brianmario Jul 15, 2013
4f7a66e
bump version for 0.2.19 release
brianmario Jul 15, 2013
7d69007
bring in master
brianmario Jul 17, 2013
ef3c82e
bump version for 0.2.20 release
brianmario Jul 17, 2013
8e7b9fd
bring in master
brianmario Nov 7, 2013
611f64c
bump for 0.2.21 release
brianmario Nov 7, 2013
c412e18
bring in master
brianmario Jan 23, 2014
3c75488
bump version for 0.2.22 release
brianmario Jan 23, 2014
91f178c
Merge branch 'master' into 0.2.x
sodabrew May 14, 2014
30b2592
Bump version to 0.2.23 (matching 0.3.16)
sodabrew May 14, 2014
4ae5366
Rather than keeping the CHARSET_MAP hack around, through thick and th…
jeremy Aug 4, 2014
1af1061
Merge branch 'master' into 0.2.x
sodabrew Nov 11, 2014
267a538
Bump version to 0.2.24
sodabrew Nov 11, 2014
84f1db2
Merge branch '0.2.x' into 0.2.x_force_latin1_to_utf8
jeremy Jun 3, 2015
c920d41
Fix for MariaDB 10.2 which does not define CLIENT_LONG_PASSWORD
sodabrew Jun 29, 2017
c23ef72
Only do version check in Windows environment
jconroy77 Sep 8, 2015
adc8816
Merge pull request #1 from makandra/tk/0.3.x-lts-ubuntu22
kratob Jul 29, 2022
428e1b6
MYSQL_SECURE_AUTH has been removed in MySQL 8.0.3 RC (#892)
yahonda Nov 11, 2017
288ba84
Use a typedef my_bool to improve compatibility across MySQL versions
sodabrew Dec 3, 2017
451c4a6
Merge branch '0.3.x-lts-heroku' into 0.3.x-lts
kratob Feb 14, 2023
cdd6eb4
Only do version check in Windows environment
jconroy77 Sep 8, 2015
a09b412
Fix for MariaDB 10.2 which does not define CLIENT_LONG_PASSWORD
sodabrew Jun 29, 2017
f5c50ef
Also search for mariadb_config on compile
ctrochalakis May 5, 2015
e23d40e
Support microseconds
lewispb Mar 29, 2023
7ef6063
Merge branch 'mariadbclient-support' into 0.3.x_mariadbclient-support
lewispb Mar 29, 2023
5413113
Merge remote-tracking branch 'makandra/0.3.x-lts' into 0.3.x_mariadbc…
lewispb Mar 31, 2023
c55cb25
Remove mysql2 adapter which is part of Rails 3.2
lewispb Mar 31, 2023
beb78d5
Match makandra 0.3.x lts
lewispb Mar 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ext/mysql2/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,10 +794,12 @@ static VALUE _mysql_client_options(VALUE self, int opt, VALUE value) {
retval = &boolval;
break;

#if defined(MYSQL_SECURE_AUTH)
case MYSQL_SECURE_AUTH:
boolval = (value == Qfalse ? 0 : 1);
retval = &boolval;
break;
#endif

case MYSQL_READ_DEFAULT_FILE:
charval = (const char *)StringValueCStr(value);
Expand Down Expand Up @@ -1182,7 +1184,10 @@ static VALUE set_ssl_options(VALUE self, VALUE key, VALUE cert, VALUE ca, VALUE
}

static VALUE set_secure_auth(VALUE self, VALUE value) {
/* This option was deprecated in MySQL 5.x and removed in MySQL 8.0 */
#if defined(MYSQL_SECURE_AUTH)
return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
#endif
}

static VALUE set_read_default_file(VALUE self, VALUE value) {
Expand Down Expand Up @@ -1210,6 +1215,7 @@ static VALUE initialize_ext(VALUE self) {
}

void init_mysql2_client() {
#ifdef _WIN32
/* verify the libmysql we're about to use was the version we were built against
https://github.com/luislavena/mysql-gem/commit/a600a9c459597da0712f70f43736e24b484f8a99 */
int i;
Expand All @@ -1227,6 +1233,7 @@ void init_mysql2_client() {
return;
}
}
#endif

/* Initializing mysql library, so different threads could call Client.new */
/* without race condition in the library */
Expand Down Expand Up @@ -1297,6 +1304,10 @@ void init_mysql2_client() {
#ifdef CLIENT_LONG_PASSWORD
rb_const_set(cMysql2Client, rb_intern("LONG_PASSWORD"),
LONG2NUM(CLIENT_LONG_PASSWORD));
#else
/* HACK because MariaDB 10.2 no longer defines this constant,
* but we're using it in our default connection flags. */
rb_const_set(cMysql2Client, rb_intern("LONG_PASSWORD"), INT2NUM(0));
#endif

#ifdef CLIENT_FOUND_ROWS
Expand Down
6 changes: 6 additions & 0 deletions ext/mysql2/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ def asplode lib
$CFLAGS << gcc_flags
end

mysql_h = [prefix, 'mysql.h'].compact.join('/')

# my_bool is replaced by C99 bool in MySQL 8.0, but we want
# to retain compatibility with the typedef in earlier MySQLs.
have_type('my_bool', mysql_h)

if RUBY_PLATFORM =~ /mswin|mingw/
# Build libmysql.a interface link library
require 'rake'
Expand Down
8 changes: 8 additions & 0 deletions ext/mysql2/mysql2_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ typedef unsigned int uint;
#define RB_MYSQL_UNUSED
#endif

/* MySQL 8.0 replaces my_bool with C99 bool. Earlier versions of MySQL had
* a typedef to char. Gem users reported failures on big endian systems when
* using C99 bool types with older MySQLs due to mismatched behavior. */
#ifndef HAVE_TYPE_MY_BOOL
#include <stdbool.h>
typedef bool my_bool;
#endif

#include <client.h>
#include <result.h>
#include <infile.h>
Expand Down