mysql2 0.5.2-x86-mswin32-60 → 0.5.3-x86-mswin32-60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +44 -28
 - data/ext/mysql2/client.c +25 -8
 - data/ext/mysql2/extconf.rb +1 -1
 - data/ext/mysql2/mysql_enc_name_to_ruby.h +60 -56
 - data/ext/mysql2/mysql_enc_to_ruby.h +56 -5
 - data/ext/mysql2/result.c +17 -11
 - data/ext/mysql2/statement.c +4 -2
 - data/lib/mysql2.rb +6 -3
 - data/lib/mysql2/2.2/mysql2.so +0 -0
 - data/lib/mysql2/2.3/mysql2.so +0 -0
 - data/lib/mysql2/2.4/mysql2.so +0 -0
 - data/lib/mysql2/2.5/mysql2.so +0 -0
 - data/lib/mysql2/2.6/mysql2.so +0 -0
 - data/lib/mysql2/client.rb +1 -1
 - data/lib/mysql2/error.rb +3 -3
 - data/lib/mysql2/version.rb +1 -1
 - data/support/5072E1F5.asc +5 -5
 - data/support/mysql_enc_to_ruby.rb +6 -1
 - data/support/ruby_enc_to_mysql.rb +2 -0
 - metadata +7 -58
 - data/examples/eventmachine.rb +0 -19
 - data/examples/threaded.rb +0 -16
 - data/lib/mysql2/2.0/mysql2.so +0 -0
 - data/lib/mysql2/2.1/mysql2.so +0 -0
 - data/spec/configuration.yml.example +0 -11
 - data/spec/em/em_spec.rb +0 -135
 - data/spec/my.cnf.example +0 -9
 - data/spec/mysql2/client_spec.rb +0 -1072
 - data/spec/mysql2/error_spec.rb +0 -78
 - data/spec/mysql2/result_spec.rb +0 -485
 - data/spec/mysql2/statement_spec.rb +0 -712
 - data/spec/rcov.opts +0 -3
 - data/spec/spec_helper.rb +0 -112
 - data/spec/ssl/ca-cert.pem +0 -17
 - data/spec/ssl/ca-key.pem +0 -27
 - data/spec/ssl/ca.cnf +0 -22
 - data/spec/ssl/cert.cnf +0 -22
 - data/spec/ssl/client-cert.pem +0 -17
 - data/spec/ssl/client-key.pem +0 -27
 - data/spec/ssl/client-req.pem +0 -15
 - data/spec/ssl/gen_certs.sh +0 -48
 - data/spec/ssl/pkcs8-client-key.pem +0 -28
 - data/spec/ssl/pkcs8-server-key.pem +0 -28
 - data/spec/ssl/server-cert.pem +0 -17
 - data/spec/ssl/server-key.pem +0 -27
 - data/spec/ssl/server-req.pem +0 -15
 - data/spec/test_data +0 -1
 
| 
         @@ -54,13 +54,13 @@ static const char *mysql2_mysql_enc_to_rb[] = { 
     | 
|
| 
       54 
54 
     | 
    
         
             
              "macRoman",
         
     | 
| 
       55 
55 
     | 
    
         
             
              "UTF-16",
         
     | 
| 
       56 
56 
     | 
    
         
             
              "UTF-16",
         
     | 
| 
       57 
     | 
    
         
            -
              "",
         
     | 
| 
      
 57 
     | 
    
         
            +
              "UTF-16LE",
         
     | 
| 
       58 
58 
     | 
    
         
             
              "Windows-1256",
         
     | 
| 
       59 
59 
     | 
    
         
             
              "Windows-1257",
         
     | 
| 
       60 
60 
     | 
    
         
             
              "Windows-1257",
         
     | 
| 
       61 
61 
     | 
    
         
             
              "UTF-32",
         
     | 
| 
       62 
62 
     | 
    
         
             
              "UTF-32",
         
     | 
| 
       63 
     | 
    
         
            -
              "",
         
     | 
| 
      
 63 
     | 
    
         
            +
              "UTF-16LE",
         
     | 
| 
       64 
64 
     | 
    
         
             
              "ASCII-8BIT",
         
     | 
| 
       65 
65 
     | 
    
         
             
              NULL,
         
     | 
| 
       66 
66 
     | 
    
         
             
              "US-ASCII",
         
     | 
| 
         @@ -74,7 +74,7 @@ static const char *mysql2_mysql_enc_to_rb[] = { 
     | 
|
| 
       74 
74 
     | 
    
         
             
              NULL,
         
     | 
| 
       75 
75 
     | 
    
         
             
              "KOI8-R",
         
     | 
| 
       76 
76 
     | 
    
         
             
              "KOI8-R",
         
     | 
| 
       77 
     | 
    
         
            -
               
     | 
| 
      
 77 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
       78 
78 
     | 
    
         
             
              "ISO-8859-2",
         
     | 
| 
       79 
79 
     | 
    
         
             
              "ISO-8859-9",
         
     | 
| 
       80 
80 
     | 
    
         
             
              "ISO-8859-13",
         
     | 
| 
         @@ -246,14 +246,65 @@ static const char *mysql2_mysql_enc_to_rb[] = { 
     | 
|
| 
       246 
246 
     | 
    
         
             
              "UTF-8",
         
     | 
| 
       247 
247 
     | 
    
         
             
              "UTF-8",
         
     | 
| 
       248 
248 
     | 
    
         
             
              "UTF-8",
         
     | 
| 
      
 249 
     | 
    
         
            +
              "GB18030",
         
     | 
| 
      
 250 
     | 
    
         
            +
              "GB18030",
         
     | 
| 
      
 251 
     | 
    
         
            +
              "GB18030",
         
     | 
| 
      
 252 
     | 
    
         
            +
              NULL,
         
     | 
| 
      
 253 
     | 
    
         
            +
              NULL,
         
     | 
| 
       249 
254 
     | 
    
         
             
              NULL,
         
     | 
| 
       250 
255 
     | 
    
         
             
              NULL,
         
     | 
| 
      
 256 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 257 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 258 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 259 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 260 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 261 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 262 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 263 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 264 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 265 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 266 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 267 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 268 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 269 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 270 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 271 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 272 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 273 
     | 
    
         
            +
              NULL,
         
     | 
| 
      
 274 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 275 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 276 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
       251 
277 
     | 
    
         
             
              NULL,
         
     | 
| 
      
 278 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 279 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 280 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 281 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 282 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 283 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 284 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 285 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 286 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 287 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 288 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 289 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 290 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 291 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 292 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 293 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 294 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 295 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
       252 
296 
     | 
    
         
             
              NULL,
         
     | 
| 
      
 297 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 298 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 299 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
       253 
300 
     | 
    
         
             
              NULL,
         
     | 
| 
      
 301 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
       254 
302 
     | 
    
         
             
              NULL,
         
     | 
| 
       255 
303 
     | 
    
         
             
              NULL,
         
     | 
| 
      
 304 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 305 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 306 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 307 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
      
 308 
     | 
    
         
            +
              "UTF-8",
         
     | 
| 
       256 
309 
     | 
    
         
             
              "UTF-8"
         
     | 
| 
       257 
310 
     | 
    
         
             
            };
         
     | 
| 
       258 
     | 
    
         
            -
             
     | 
| 
       259 
     | 
    
         
            -
            #define CHARSETNR_SIZE (sizeof(mysql2_mysql_enc_to_rb)/sizeof(mysql2_mysql_enc_to_rb[0]))
         
     | 
    
        data/ext/mysql2/result.c
    CHANGED
    
    | 
         @@ -1,6 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #include <mysql2_ext.h>
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            #include "mysql_enc_to_ruby.h"
         
     | 
| 
      
 4 
     | 
    
         
            +
            #define MYSQL2_CHARSETNR_SIZE (sizeof(mysql2_mysql_enc_to_rb)/sizeof(mysql2_mysql_enc_to_rb[0]))
         
     | 
| 
       4 
5 
     | 
    
         | 
| 
       5 
6 
     | 
    
         
             
            static rb_encoding *binaryEncoding;
         
     | 
| 
       6 
7 
     | 
    
         | 
| 
         @@ -29,14 +30,15 @@ typedef struct { 
     | 
|
| 
       29 
30 
     | 
    
         
             
              int streaming;
         
     | 
| 
       30 
31 
     | 
    
         
             
              ID db_timezone;
         
     | 
| 
       31 
32 
     | 
    
         
             
              ID app_timezone;
         
     | 
| 
       32 
     | 
    
         
            -
               
     | 
| 
      
 33 
     | 
    
         
            +
              int block_given; /* boolean */
         
     | 
| 
       33 
34 
     | 
    
         
             
            } result_each_args;
         
     | 
| 
       34 
35 
     | 
    
         | 
| 
       35 
36 
     | 
    
         
             
            extern VALUE mMysql2, cMysql2Client, cMysql2Error;
         
     | 
| 
       36 
37 
     | 
    
         
             
            static VALUE cMysql2Result, cDateTime, cDate;
         
     | 
| 
       37 
38 
     | 
    
         
             
            static VALUE opt_decimal_zero, opt_float_zero, opt_time_year, opt_time_month, opt_utc_offset;
         
     | 
| 
       38 
39 
     | 
    
         
             
            static ID intern_new, intern_utc, intern_local, intern_localtime, intern_local_offset,
         
     | 
| 
       39 
     | 
    
         
            -
              intern_civil, intern_new_offset, intern_merge, intern_BigDecimal 
     | 
| 
      
 40 
     | 
    
         
            +
              intern_civil, intern_new_offset, intern_merge, intern_BigDecimal,
         
     | 
| 
      
 41 
     | 
    
         
            +
              intern_query_options;
         
     | 
| 
       40 
42 
     | 
    
         
             
            static VALUE sym_symbolize_keys, sym_as, sym_array, sym_database_timezone,
         
     | 
| 
       41 
43 
     | 
    
         
             
              sym_application_timezone, sym_local, sym_utc, sym_cast_booleans,
         
     | 
| 
       42 
44 
     | 
    
         
             
              sym_cache_rows, sym_cast, sym_stream, sym_name;
         
     | 
| 
         @@ -179,7 +181,7 @@ static VALUE mysql2_set_field_string_encoding(VALUE val, MYSQL_FIELD field, rb_e 
     | 
|
| 
       179 
181 
     | 
    
         
             
                const char *enc_name;
         
     | 
| 
       180 
182 
     | 
    
         
             
                int enc_index;
         
     | 
| 
       181 
183 
     | 
    
         | 
| 
       182 
     | 
    
         
            -
                enc_name = (field.charsetnr-1 <  
     | 
| 
      
 184 
     | 
    
         
            +
                enc_name = (field.charsetnr-1 < MYSQL2_CHARSETNR_SIZE) ? mysql2_mysql_enc_to_rb[field.charsetnr-1] : NULL;
         
     | 
| 
       183 
185 
     | 
    
         | 
| 
       184 
186 
     | 
    
         
             
                if (enc_name != NULL) {
         
     | 
| 
       185 
187 
     | 
    
         
             
                  /* use the field encoding we were able to match */
         
     | 
| 
         @@ -694,7 +696,7 @@ static VALUE rb_mysql_result_fetch_fields(VALUE self) { 
     | 
|
| 
       694 
696 
     | 
    
         | 
| 
       695 
697 
     | 
    
         
             
              GET_RESULT(self);
         
     | 
| 
       696 
698 
     | 
    
         | 
| 
       697 
     | 
    
         
            -
              defaults =  
     | 
| 
      
 699 
     | 
    
         
            +
              defaults = rb_ivar_get(self, intern_query_options);
         
     | 
| 
       698 
700 
     | 
    
         
             
              Check_Type(defaults, T_HASH);
         
     | 
| 
       699 
701 
     | 
    
         
             
              if (rb_hash_aref(defaults, sym_symbolize_keys) == Qtrue) {
         
     | 
| 
       700 
702 
     | 
    
         
             
                symbolizeKeys = 1;
         
     | 
| 
         @@ -739,7 +741,7 @@ static VALUE rb_mysql_result_each_(VALUE self, 
     | 
|
| 
       739 
741 
     | 
    
         
             
                    row = fetch_row_func(self, fields, args);
         
     | 
| 
       740 
742 
     | 
    
         
             
                    if (row != Qnil) {
         
     | 
| 
       741 
743 
     | 
    
         
             
                      wrapper->numberOfRows++;
         
     | 
| 
       742 
     | 
    
         
            -
                      if (args->block_given 
     | 
| 
      
 744 
     | 
    
         
            +
                      if (args->block_given) {
         
     | 
| 
       743 
745 
     | 
    
         
             
                        rb_yield(row);
         
     | 
| 
       744 
746 
     | 
    
         
             
                      }
         
     | 
| 
       745 
747 
     | 
    
         
             
                    }
         
     | 
| 
         @@ -789,7 +791,7 @@ static VALUE rb_mysql_result_each_(VALUE self, 
     | 
|
| 
       789 
791 
     | 
    
         
             
                      return Qnil;
         
     | 
| 
       790 
792 
     | 
    
         
             
                    }
         
     | 
| 
       791 
793 
     | 
    
         | 
| 
       792 
     | 
    
         
            -
                    if (args->block_given 
     | 
| 
      
 794 
     | 
    
         
            +
                    if (args->block_given) {
         
     | 
| 
       793 
795 
     | 
    
         
             
                      rb_yield(row);
         
     | 
| 
       794 
796 
     | 
    
         
             
                    }
         
     | 
| 
       795 
797 
     | 
    
         
             
                  }
         
     | 
| 
         @@ -807,7 +809,7 @@ static VALUE rb_mysql_result_each_(VALUE self, 
     | 
|
| 
       807 
809 
     | 
    
         | 
| 
       808 
810 
     | 
    
         
             
            static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self) {
         
     | 
| 
       809 
811 
     | 
    
         
             
              result_each_args args;
         
     | 
| 
       810 
     | 
    
         
            -
              VALUE defaults, opts,  
     | 
| 
      
 812 
     | 
    
         
            +
              VALUE defaults, opts, (*fetch_row_func)(VALUE, MYSQL_FIELD *fields, const result_each_args *args);
         
     | 
| 
       811 
813 
     | 
    
         
             
              ID db_timezone, app_timezone, dbTz, appTz;
         
     | 
| 
       812 
814 
     | 
    
         
             
              int symbolizeKeys, asArray, castBool, cacheRows, cast;
         
     | 
| 
       813 
815 
     | 
    
         | 
| 
         @@ -817,9 +819,12 @@ static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self) { 
     | 
|
| 
       817 
819 
     | 
    
         
             
                rb_raise(cMysql2Error, "Statement handle already closed");
         
     | 
| 
       818 
820 
     | 
    
         
             
              }
         
     | 
| 
       819 
821 
     | 
    
         | 
| 
       820 
     | 
    
         
            -
              defaults =  
     | 
| 
      
 822 
     | 
    
         
            +
              defaults = rb_ivar_get(self, intern_query_options);
         
     | 
| 
       821 
823 
     | 
    
         
             
              Check_Type(defaults, T_HASH);
         
     | 
| 
       822 
     | 
    
         
            -
             
     | 
| 
      
 824 
     | 
    
         
            +
             
     | 
| 
      
 825 
     | 
    
         
            +
              // A block can be passed to this method, but since we don't call the block directly from C,
         
     | 
| 
      
 826 
     | 
    
         
            +
              // we don't need to capture it into a variable here with the "&" scan arg.
         
     | 
| 
      
 827 
     | 
    
         
            +
              if (rb_scan_args(argc, argv, "01", &opts) == 1) {
         
     | 
| 
       823 
828 
     | 
    
         
             
                opts = rb_funcall(defaults, intern_merge, 1, opts);
         
     | 
| 
       824 
829 
     | 
    
         
             
              } else {
         
     | 
| 
       825 
830 
     | 
    
         
             
                opts = defaults;
         
     | 
| 
         @@ -885,7 +890,7 @@ static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self) { 
     | 
|
| 
       885 
890 
     | 
    
         
             
              args.cast = cast;
         
     | 
| 
       886 
891 
     | 
    
         
             
              args.db_timezone = db_timezone;
         
     | 
| 
       887 
892 
     | 
    
         
             
              args.app_timezone = app_timezone;
         
     | 
| 
       888 
     | 
    
         
            -
              args.block_given =  
     | 
| 
      
 893 
     | 
    
         
            +
              args.block_given = rb_block_given_p();
         
     | 
| 
       889 
894 
     | 
    
         | 
| 
       890 
895 
     | 
    
         
             
              if (wrapper->stmt_wrapper) {
         
     | 
| 
       891 
896 
     | 
    
         
             
                fetch_row_func = rb_mysql_result_fetch_row_stmt;
         
     | 
| 
         @@ -950,7 +955,7 @@ VALUE rb_mysql_result_to_obj(VALUE client, VALUE encoding, VALUE options, MYSQL_ 
     | 
|
| 
       950 
955 
     | 
    
         
             
              }
         
     | 
| 
       951 
956 
     | 
    
         | 
| 
       952 
957 
     | 
    
         
             
              rb_obj_call_init(obj, 0, NULL);
         
     | 
| 
       953 
     | 
    
         
            -
               
     | 
| 
      
 958 
     | 
    
         
            +
              rb_ivar_set(obj, intern_query_options, options);
         
     | 
| 
       954 
959 
     | 
    
         | 
| 
       955 
960 
     | 
    
         
             
              /* Options that cannot be changed in results.each(...) { |row| }
         
     | 
| 
       956 
961 
     | 
    
         
             
               * should be processed here. */
         
     | 
| 
         @@ -979,6 +984,7 @@ void init_mysql2_result() { 
     | 
|
| 
       979 
984 
     | 
    
         
             
              intern_civil        = rb_intern("civil");
         
     | 
| 
       980 
985 
     | 
    
         
             
              intern_new_offset   = rb_intern("new_offset");
         
     | 
| 
       981 
986 
     | 
    
         
             
              intern_BigDecimal   = rb_intern("BigDecimal");
         
     | 
| 
      
 987 
     | 
    
         
            +
              intern_query_options = rb_intern("@query_options");
         
     | 
| 
       982 
988 
     | 
    
         | 
| 
       983 
989 
     | 
    
         
             
              sym_symbolize_keys  = ID2SYM(rb_intern("symbolize_keys"));
         
     | 
| 
       984 
990 
     | 
    
         
             
              sym_as              = ID2SYM(rb_intern("as"));
         
     | 
    
        data/ext/mysql2/statement.c
    CHANGED
    
    | 
         @@ -3,7 +3,8 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            extern VALUE mMysql2, cMysql2Error;
         
     | 
| 
       4 
4 
     | 
    
         
             
            static VALUE cMysql2Statement, cBigDecimal, cDateTime, cDate;
         
     | 
| 
       5 
5 
     | 
    
         
             
            static VALUE sym_stream, intern_new_with_args, intern_each, intern_to_s, intern_merge_bang;
         
     | 
| 
       6 
     | 
    
         
            -
            static VALUE intern_sec_fraction, intern_usec, intern_sec, intern_min, intern_hour, intern_day, intern_month, intern_year 
     | 
| 
      
 6 
     | 
    
         
            +
            static VALUE intern_sec_fraction, intern_usec, intern_sec, intern_min, intern_hour, intern_day, intern_month, intern_year,
         
     | 
| 
      
 7 
     | 
    
         
            +
              intern_query_options;
         
     | 
| 
       7 
8 
     | 
    
         | 
| 
       8 
9 
     | 
    
         
             
            #define GET_STATEMENT(self) \
         
     | 
| 
       9 
10 
     | 
    
         
             
              mysql_stmt_wrapper *stmt_wrapper; \
         
     | 
| 
         @@ -404,7 +405,7 @@ static VALUE rb_mysql_stmt_execute(int argc, VALUE *argv, VALUE self) { 
     | 
|
| 
       404 
405 
     | 
    
         
             
              }
         
     | 
| 
       405 
406 
     | 
    
         | 
| 
       406 
407 
     | 
    
         
             
              // Duplicate the options hash, merge! extra opts, put the copy into the Result object
         
     | 
| 
       407 
     | 
    
         
            -
              current = rb_hash_dup( 
     | 
| 
      
 408 
     | 
    
         
            +
              current = rb_hash_dup(rb_ivar_get(stmt_wrapper->client, intern_query_options));
         
     | 
| 
       408 
409 
     | 
    
         
             
              (void)RB_GC_GUARD(current);
         
     | 
| 
       409 
410 
     | 
    
         
             
              Check_Type(current, T_HASH);
         
     | 
| 
       410 
411 
     | 
    
         | 
| 
         @@ -599,4 +600,5 @@ void init_mysql2_statement() { 
     | 
|
| 
       599 
600 
     | 
    
         | 
| 
       600 
601 
     | 
    
         
             
              intern_to_s = rb_intern("to_s");
         
     | 
| 
       601 
602 
     | 
    
         
             
              intern_merge_bang = rb_intern("merge!");
         
     | 
| 
      
 603 
     | 
    
         
            +
              intern_query_options = rb_intern("@query_options");
         
     | 
| 
       602 
604 
     | 
    
         
             
            }
         
     | 
    
        data/lib/mysql2.rb
    CHANGED
    
    | 
         @@ -20,9 +20,12 @@ if RUBY_PLATFORM =~ /mswin|mingw/ 
     | 
|
| 
       20 
20 
     | 
    
         
             
              end
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
              if dll_path
         
     | 
| 
       23 
     | 
    
         
            -
                require ' 
     | 
| 
       24 
     | 
    
         
            -
                 
     | 
| 
       25 
     | 
    
         
            -
                 
     | 
| 
      
 23 
     | 
    
         
            +
                require 'fiddle'
         
     | 
| 
      
 24 
     | 
    
         
            +
                kernel32 = Fiddle.dlopen 'kernel32'
         
     | 
| 
      
 25 
     | 
    
         
            +
                load_library = Fiddle::Function.new(
         
     | 
| 
      
 26 
     | 
    
         
            +
                  kernel32['LoadLibraryW'], [Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT,
         
     | 
| 
      
 27 
     | 
    
         
            +
                )
         
     | 
| 
      
 28 
     | 
    
         
            +
                if load_library.call(dll_path.encode('utf-16le')).zero?
         
     | 
| 
       26 
29 
     | 
    
         
             
                  abort "Failed to load libmysql.dll from #{dll_path}"
         
     | 
| 
       27 
30 
     | 
    
         
             
                end
         
     | 
| 
       28 
31 
     | 
    
         
             
              end
         
     | 
    
        data/lib/mysql2/2.2/mysql2.so
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/lib/mysql2/2.3/mysql2.so
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/lib/mysql2/2.4/mysql2.so
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/lib/mysql2/2.5/mysql2.so
    CHANGED
    
    | 
         Binary file 
     | 
| 
         Binary file 
     | 
    
        data/lib/mysql2/client.rb
    CHANGED
    
    | 
         @@ -31,7 +31,7 @@ module Mysql2 
     | 
|
| 
       31 
31 
     | 
    
         
             
                  opts[:connect_timeout] = 120 unless opts.key?(:connect_timeout)
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                  # TODO: stricter validation rather than silent massaging
         
     | 
| 
       34 
     | 
    
         
            -
                  %i[reconnect connect_timeout local_infile read_timeout write_timeout default_file default_group secure_auth init_command automatic_close enable_cleartext_plugin].each do |key|
         
     | 
| 
      
 34 
     | 
    
         
            +
                  %i[reconnect connect_timeout local_infile read_timeout write_timeout default_file default_group secure_auth init_command automatic_close enable_cleartext_plugin default_auth].each do |key|
         
     | 
| 
       35 
35 
     | 
    
         
             
                    next unless opts.key?(key)
         
     | 
| 
       36 
36 
     | 
    
         
             
                    case key
         
     | 
| 
       37 
37 
     | 
    
         
             
                    when :reconnect, :local_infile, :secure_auth, :automatic_close, :enable_cleartext_plugin
         
     | 
    
        data/lib/mysql2/error.rb
    CHANGED
    
    | 
         @@ -52,7 +52,7 @@ module Mysql2 
     | 
|
| 
       52 
52 
     | 
    
         
             
                def initialize(msg, server_version = nil, error_number = nil, sql_state = nil)
         
     | 
| 
       53 
53 
     | 
    
         
             
                  @server_version = server_version
         
     | 
| 
       54 
54 
     | 
    
         
             
                  @error_number = error_number
         
     | 
| 
       55 
     | 
    
         
            -
                  @sql_state = sql_state ? sql_state.encode(ENCODE_OPTS) : nil
         
     | 
| 
      
 55 
     | 
    
         
            +
                  @sql_state = sql_state ? sql_state.encode(**ENCODE_OPTS) : nil
         
     | 
| 
       56 
56 
     | 
    
         | 
| 
       57 
57 
     | 
    
         
             
                  super(clean_message(msg))
         
     | 
| 
       58 
58 
     | 
    
         
             
                end
         
     | 
| 
         @@ -91,9 +91,9 @@ module Mysql2 
     | 
|
| 
       91 
91 
     | 
    
         
             
                # Returns a valid UTF-8 string.
         
     | 
| 
       92 
92 
     | 
    
         
             
                def clean_message(message)
         
     | 
| 
       93 
93 
     | 
    
         
             
                  if @server_version && @server_version > 50500
         
     | 
| 
       94 
     | 
    
         
            -
                    message.encode(ENCODE_OPTS)
         
     | 
| 
      
 94 
     | 
    
         
            +
                    message.encode(**ENCODE_OPTS)
         
     | 
| 
       95 
95 
     | 
    
         
             
                  else
         
     | 
| 
       96 
     | 
    
         
            -
                    message.encode(Encoding::UTF_8, ENCODE_OPTS)
         
     | 
| 
      
 96 
     | 
    
         
            +
                    message.encode(Encoding::UTF_8, **ENCODE_OPTS)
         
     | 
| 
       97 
97 
     | 
    
         
             
                  end
         
     | 
| 
       98 
98 
     | 
    
         
             
                end
         
     | 
| 
       99 
99 
     | 
    
         
             
              end
         
     | 
    
        data/lib/mysql2/version.rb
    CHANGED
    
    
    
        data/support/5072E1F5.asc
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            -----BEGIN PGP PUBLIC KEY BLOCK-----
         
     | 
| 
       2 
     | 
    
         
            -
            Version: GnuPG v1 
     | 
| 
      
 2 
     | 
    
         
            +
            Version: GnuPG v1
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3
         
     | 
| 
       5 
5 
     | 
    
         
             
            RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ
         
     | 
| 
         @@ -11,9 +11,9 @@ kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI 
     | 
|
| 
       11 
11 
     | 
    
         
             
            QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep
         
     | 
| 
       12 
12 
     | 
    
         
             
            rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q2TXlTUUwgUmVs
         
     | 
| 
       13 
13 
     | 
    
         
             
            ZWFzZSBFbmdpbmVlcmluZyA8bXlzcWwtYnVpbGRAb3NzLm9yYWNsZS5jb20+iGwE
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
      
 14 
     | 
    
         
            +
            ExECACwCGyMCHgECF4ACGQEGCwkIBwMCBhUKCQgCAwUWAgMBAAUCXEBY+wUJI87e
         
     | 
| 
      
 15 
     | 
    
         
            +
            5AAKCRCMcY07UHLh9RZPAJ9uvm0zlzfCN+DHxHVaoFLFjdVYTQCfborsC9tmEZYa
         
     | 
| 
      
 16 
     | 
    
         
            +
            whhogjeBkZkorbyIaQQTEQIAKQIbIwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAhkB
         
     | 
| 
       17 
17 
     | 
    
         
             
            BQJTAdRmBQkaZsvLAAoJEIxxjTtQcuH1X4MAoKNLWAbCBUj96637kv6Xa/fJuX5m
         
     | 
| 
       18 
18 
     | 
    
         
             
            AJwPtmgDfjUe2iuhXdTrFEPT19SB6ohmBBMRAgAmAhsjBgsJCAcDAgQVAggDBBYC
         
     | 
| 
       19 
19 
     | 
    
         
             
            AwECHgECF4AFAk53PioFCRP7AhUACgkQjHGNO1By4fUmzACeJdfqgc9gWTUhgmcM
         
     | 
| 
         @@ -428,5 +428,5 @@ GoaU9u41oyZTIiXPiFidJoIZCh7fdurP8pn3X+R5HUNXMr7M+ba8lSNxce/F3kmH 
     | 
|
| 
       428 
428 
     | 
    
         
             
            0L7rsKqdh9d/aVxhJINJ+inVDnrXWVoXu9GBjT8Nco1iU9SIVAQYEQIADAUCTnc9
         
     | 
| 
       429 
429 
     | 
    
         
             
            7QUJE/sBuAASB2VHUEcAAQEJEIxxjTtQcuH1FJsAmwWK9vmwRJ/y9gTnJ8PWf0BV
         
     | 
| 
       430 
430 
     | 
    
         
             
            roUTAKClYAhZuX2nUNwH4vlEJQHDqYa5yQ==
         
     | 
| 
       431 
     | 
    
         
            -
            = 
     | 
| 
      
 431 
     | 
    
         
            +
            =ghXk
         
     | 
| 
       432 
432 
     | 
    
         
             
            -----END PGP PUBLIC KEY BLOCK-----
         
     | 
| 
         @@ -43,6 +43,8 @@ mysql_to_rb = { 
     | 
|
| 
       43 
43 
     | 
    
         
             
              "geostd8"  => "NULL",
         
     | 
| 
       44 
44 
     | 
    
         
             
              "cp932"    => "Windows-31J",
         
     | 
| 
       45 
45 
     | 
    
         
             
              "eucjpms"  => "eucJP-ms",
         
     | 
| 
      
 46 
     | 
    
         
            +
              "utf16le"  => "UTF-16LE",
         
     | 
| 
      
 47 
     | 
    
         
            +
              "gb18030"  => "GB18030",
         
     | 
| 
       46 
48 
     | 
    
         
             
            }
         
     | 
| 
       47 
49 
     | 
    
         | 
| 
       48 
50 
     | 
    
         
             
            client     = Mysql2::Client.new(username: user, password: pass, host: host, port: port.to_i)
         
     | 
| 
         @@ -52,7 +54,10 @@ encodings_with_nil = Array.new(encodings.size) 
     | 
|
| 
       52 
54 
     | 
    
         | 
| 
       53 
55 
     | 
    
         
             
            collations.each do |collation|
         
     | 
| 
       54 
56 
     | 
    
         
             
              mysql_col_idx = collation[2].to_i
         
     | 
| 
       55 
     | 
    
         
            -
              rb_enc = mysql_to_rb 
     | 
| 
      
 57 
     | 
    
         
            +
              rb_enc = mysql_to_rb.fetch(collation[1]) do |mysql_enc|
         
     | 
| 
      
 58 
     | 
    
         
            +
                $stderr.puts "WARNING: Missing mapping for collation \"#{collation[0]}\" with encoding \"#{mysql_enc}\" and id #{mysql_col_idx}, assuming NULL"
         
     | 
| 
      
 59 
     | 
    
         
            +
                "NULL"
         
     | 
| 
      
 60 
     | 
    
         
            +
              end
         
     | 
| 
       56 
61 
     | 
    
         
             
              encodings[mysql_col_idx - 1] = [mysql_col_idx, rb_enc]
         
     | 
| 
       57 
62 
     | 
    
         
             
            end
         
     | 
| 
       58 
63 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: mysql2
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.5. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.5.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: x86-mswin32-60
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Brian Lopez
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date:  
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2019-11-27 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       14 
14 
     | 
    
         
             
            description: 
         
     | 
| 
       15 
15 
     | 
    
         
             
            email:
         
     | 
| 
         @@ -22,8 +22,6 @@ files: 
     | 
|
| 
       22 
22 
     | 
    
         
             
            - CHANGELOG.md
         
     | 
| 
       23 
23 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       24 
24 
     | 
    
         
             
            - README.md
         
     | 
| 
       25 
     | 
    
         
            -
            - examples/eventmachine.rb
         
     | 
| 
       26 
     | 
    
         
            -
            - examples/threaded.rb
         
     | 
| 
       27 
25 
     | 
    
         
             
            - ext/mysql2/client.c
         
     | 
| 
       28 
26 
     | 
    
         
             
            - ext/mysql2/client.h
         
     | 
| 
       29 
27 
     | 
    
         
             
            - ext/mysql2/extconf.rb
         
     | 
| 
         @@ -39,12 +37,11 @@ files: 
     | 
|
| 
       39 
37 
     | 
    
         
             
            - ext/mysql2/statement.h
         
     | 
| 
       40 
38 
     | 
    
         
             
            - ext/mysql2/wait_for_single_fd.h
         
     | 
| 
       41 
39 
     | 
    
         
             
            - lib/mysql2.rb
         
     | 
| 
       42 
     | 
    
         
            -
            - lib/mysql2/2.0/mysql2.so
         
     | 
| 
       43 
     | 
    
         
            -
            - lib/mysql2/2.1/mysql2.so
         
     | 
| 
       44 
40 
     | 
    
         
             
            - lib/mysql2/2.2/mysql2.so
         
     | 
| 
       45 
41 
     | 
    
         
             
            - lib/mysql2/2.3/mysql2.so
         
     | 
| 
       46 
42 
     | 
    
         
             
            - lib/mysql2/2.4/mysql2.so
         
     | 
| 
       47 
43 
     | 
    
         
             
            - lib/mysql2/2.5/mysql2.so
         
     | 
| 
      
 44 
     | 
    
         
            +
            - lib/mysql2/2.6/mysql2.so
         
     | 
| 
       48 
45 
     | 
    
         
             
            - lib/mysql2/client.rb
         
     | 
| 
       49 
46 
     | 
    
         
             
            - lib/mysql2/console.rb
         
     | 
| 
       50 
47 
     | 
    
         
             
            - lib/mysql2/em.rb
         
     | 
| 
         @@ -54,29 +51,6 @@ files: 
     | 
|
| 
       54 
51 
     | 
    
         
             
            - lib/mysql2/result.rb
         
     | 
| 
       55 
52 
     | 
    
         
             
            - lib/mysql2/statement.rb
         
     | 
| 
       56 
53 
     | 
    
         
             
            - lib/mysql2/version.rb
         
     | 
| 
       57 
     | 
    
         
            -
            - spec/configuration.yml.example
         
     | 
| 
       58 
     | 
    
         
            -
            - spec/em/em_spec.rb
         
     | 
| 
       59 
     | 
    
         
            -
            - spec/my.cnf.example
         
     | 
| 
       60 
     | 
    
         
            -
            - spec/mysql2/client_spec.rb
         
     | 
| 
       61 
     | 
    
         
            -
            - spec/mysql2/error_spec.rb
         
     | 
| 
       62 
     | 
    
         
            -
            - spec/mysql2/result_spec.rb
         
     | 
| 
       63 
     | 
    
         
            -
            - spec/mysql2/statement_spec.rb
         
     | 
| 
       64 
     | 
    
         
            -
            - spec/rcov.opts
         
     | 
| 
       65 
     | 
    
         
            -
            - spec/spec_helper.rb
         
     | 
| 
       66 
     | 
    
         
            -
            - spec/ssl/ca-cert.pem
         
     | 
| 
       67 
     | 
    
         
            -
            - spec/ssl/ca-key.pem
         
     | 
| 
       68 
     | 
    
         
            -
            - spec/ssl/ca.cnf
         
     | 
| 
       69 
     | 
    
         
            -
            - spec/ssl/cert.cnf
         
     | 
| 
       70 
     | 
    
         
            -
            - spec/ssl/client-cert.pem
         
     | 
| 
       71 
     | 
    
         
            -
            - spec/ssl/client-key.pem
         
     | 
| 
       72 
     | 
    
         
            -
            - spec/ssl/client-req.pem
         
     | 
| 
       73 
     | 
    
         
            -
            - spec/ssl/gen_certs.sh
         
     | 
| 
       74 
     | 
    
         
            -
            - spec/ssl/pkcs8-client-key.pem
         
     | 
| 
       75 
     | 
    
         
            -
            - spec/ssl/pkcs8-server-key.pem
         
     | 
| 
       76 
     | 
    
         
            -
            - spec/ssl/server-cert.pem
         
     | 
| 
       77 
     | 
    
         
            -
            - spec/ssl/server-key.pem
         
     | 
| 
       78 
     | 
    
         
            -
            - spec/ssl/server-req.pem
         
     | 
| 
       79 
     | 
    
         
            -
            - spec/test_data
         
     | 
| 
       80 
54 
     | 
    
         
             
            - support/5072E1F5.asc
         
     | 
| 
       81 
55 
     | 
    
         
             
            - support/libmysql.def
         
     | 
| 
       82 
56 
     | 
    
         
             
            - support/mysql_enc_to_ruby.rb
         
     | 
| 
         @@ -110,10 +84,10 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       110 
84 
     | 
    
         
             
              requirements:
         
     | 
| 
       111 
85 
     | 
    
         
             
              - - ">="
         
     | 
| 
       112 
86 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       113 
     | 
    
         
            -
                  version: '2. 
     | 
| 
      
 87 
     | 
    
         
            +
                  version: '2.2'
         
     | 
| 
       114 
88 
     | 
    
         
             
              - - "<"
         
     | 
| 
       115 
89 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       116 
     | 
    
         
            -
                  version:  
     | 
| 
      
 90 
     | 
    
         
            +
                  version: 2.7.dev
         
     | 
| 
       117 
91 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       118 
92 
     | 
    
         
             
              requirements:
         
     | 
| 
       119 
93 
     | 
    
         
             
              - - ">="
         
     | 
| 
         @@ -121,33 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       121 
95 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       122 
96 
     | 
    
         
             
            requirements: []
         
     | 
| 
       123 
97 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       124 
     | 
    
         
            -
            rubygems_version: 2.7. 
     | 
| 
      
 98 
     | 
    
         
            +
            rubygems_version: 2.7.9
         
     | 
| 
       125 
99 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       126 
100 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       127 
101 
     | 
    
         
             
            summary: A simple, fast Mysql library for Ruby, binding to libmysql
         
     | 
| 
       128 
     | 
    
         
            -
            test_files:
         
     | 
| 
       129 
     | 
    
         
            -
            - examples/eventmachine.rb
         
     | 
| 
       130 
     | 
    
         
            -
            - examples/threaded.rb
         
     | 
| 
       131 
     | 
    
         
            -
            - spec/configuration.yml.example
         
     | 
| 
       132 
     | 
    
         
            -
            - spec/em/em_spec.rb
         
     | 
| 
       133 
     | 
    
         
            -
            - spec/my.cnf.example
         
     | 
| 
       134 
     | 
    
         
            -
            - spec/mysql2/client_spec.rb
         
     | 
| 
       135 
     | 
    
         
            -
            - spec/mysql2/error_spec.rb
         
     | 
| 
       136 
     | 
    
         
            -
            - spec/mysql2/result_spec.rb
         
     | 
| 
       137 
     | 
    
         
            -
            - spec/mysql2/statement_spec.rb
         
     | 
| 
       138 
     | 
    
         
            -
            - spec/rcov.opts
         
     | 
| 
       139 
     | 
    
         
            -
            - spec/spec_helper.rb
         
     | 
| 
       140 
     | 
    
         
            -
            - spec/ssl/ca-cert.pem
         
     | 
| 
       141 
     | 
    
         
            -
            - spec/ssl/ca-key.pem
         
     | 
| 
       142 
     | 
    
         
            -
            - spec/ssl/ca.cnf
         
     | 
| 
       143 
     | 
    
         
            -
            - spec/ssl/cert.cnf
         
     | 
| 
       144 
     | 
    
         
            -
            - spec/ssl/client-cert.pem
         
     | 
| 
       145 
     | 
    
         
            -
            - spec/ssl/client-key.pem
         
     | 
| 
       146 
     | 
    
         
            -
            - spec/ssl/client-req.pem
         
     | 
| 
       147 
     | 
    
         
            -
            - spec/ssl/gen_certs.sh
         
     | 
| 
       148 
     | 
    
         
            -
            - spec/ssl/pkcs8-client-key.pem
         
     | 
| 
       149 
     | 
    
         
            -
            - spec/ssl/pkcs8-server-key.pem
         
     | 
| 
       150 
     | 
    
         
            -
            - spec/ssl/server-cert.pem
         
     | 
| 
       151 
     | 
    
         
            -
            - spec/ssl/server-key.pem
         
     | 
| 
       152 
     | 
    
         
            -
            - spec/ssl/server-req.pem
         
     | 
| 
       153 
     | 
    
         
            -
            - spec/test_data
         
     | 
| 
      
 102 
     | 
    
         
            +
            test_files: []
         
     |