sbf-do_mysql 0.10.17

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.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog.markdown +116 -0
  3. data/LICENSE +20 -0
  4. data/README.markdown +100 -0
  5. data/Rakefile +25 -0
  6. data/ext/do_mysql/compat.h +55 -0
  7. data/ext/do_mysql/do_common.c +510 -0
  8. data/ext/do_mysql/do_common.h +132 -0
  9. data/ext/do_mysql/do_mysql.c +691 -0
  10. data/ext/do_mysql/error.h +403 -0
  11. data/ext/do_mysql/extconf.rb +87 -0
  12. data/ext/do_mysql/mysql_compat.h +25 -0
  13. data/lib/do_mysql/encoding.rb +39 -0
  14. data/lib/do_mysql/transaction.rb +31 -0
  15. data/lib/do_mysql/version.rb +5 -0
  16. data/lib/do_mysql.rb +24 -0
  17. data/spec/command_spec.rb +7 -0
  18. data/spec/connection_spec.rb +55 -0
  19. data/spec/encoding_spec.rb +46 -0
  20. data/spec/error/sql_error_spec.rb +6 -0
  21. data/spec/reader_spec.rb +29 -0
  22. data/spec/result_spec.rb +38 -0
  23. data/spec/spec_helper.rb +242 -0
  24. data/spec/typecast/array_spec.rb +6 -0
  25. data/spec/typecast/bigdecimal_spec.rb +7 -0
  26. data/spec/typecast/boolean_spec.rb +7 -0
  27. data/spec/typecast/byte_array_spec.rb +6 -0
  28. data/spec/typecast/class_spec.rb +6 -0
  29. data/spec/typecast/date_spec.rb +30 -0
  30. data/spec/typecast/datetime_spec.rb +30 -0
  31. data/spec/typecast/float_spec.rb +7 -0
  32. data/spec/typecast/integer_spec.rb +6 -0
  33. data/spec/typecast/nil_spec.rb +8 -0
  34. data/spec/typecast/other_spec.rb +6 -0
  35. data/spec/typecast/range_spec.rb +6 -0
  36. data/spec/typecast/string_spec.rb +6 -0
  37. data/spec/typecast/time_spec.rb +6 -0
  38. data/tasks/compile.rake +16 -0
  39. data/tasks/release.rake +14 -0
  40. data/tasks/retrieve.rake +20 -0
  41. data/tasks/spec.rake +10 -0
  42. data/tasks/ssl.rake +26 -0
  43. metadata +101 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 47b4c4ea1ffbcf2bb6232e2ff30a185e496d023e1c20c23fa81c0268df46b000
4
+ data.tar.gz: af220a326c07d9f5b21f09728c460fddde90253aec3cab6fc674f8ae45294848
5
+ SHA512:
6
+ metadata.gz: b5ebd3fe04aa31098a99cdb175c16ef66b21a7d02ff322e3922a544c164c5de0f13baa709fd3f3747c2e2b693ac78707794a61c93605816b6060311f38826305
7
+ data.tar.gz: 91aca75a4edc2c56fde0869392fc42e041ffc217094c116468510689469b704ddb2721d9fc46461ad49d95f3c4add13a930b1107435af9b5e2f6f07c7129e9ee
@@ -0,0 +1,116 @@
1
+ ## 0.10.17 2016-01-24
2
+
3
+ * Improve utf8mb4 support
4
+ * Fix memory leak
5
+ * Support for MySQL 5.7
6
+ * Fix bug with DateTime and wrong timezone offsets
7
+
8
+ ## 0.10.16 2015-05-17
9
+
10
+ No changes
11
+
12
+ ## 0.10.15 2015-02-15
13
+
14
+ * Ruby 2.2 support
15
+ * utf8mb4 support on do\_mysql
16
+ * Windows support on 2.1.x and 2.2.x
17
+
18
+ ## 0.10.14 2014-02-13
19
+
20
+ * Don't do DNS lookup in transaction loading
21
+
22
+ ## 0.10.13 2013-05-27
23
+
24
+ * Windows binary for Ruby 2.0
25
+
26
+ ## 0.10.12 2013-01-21
27
+
28
+ * jdbc-mysql driver loading fix
29
+ * Improve compatibility for anscient MySQL versions
30
+
31
+ ## 0.10.11 2012-12-29
32
+
33
+ * Rename C symbols to prevent name collitions
34
+
35
+ ## 0.10.10 2012-10-11
36
+
37
+ No changes
38
+
39
+ ## 0.10.9 2012-08-13
40
+
41
+ * Handle bigint insert id's
42
+ * Add handling for invalid date and datetimes with value 0000-00-00
43
+ * Handle empty database names for connecting to the default database
44
+
45
+ ## 0.10.8 2012-02-10
46
+
47
+ * Ruby 1.9.3 compatibility on Windows
48
+
49
+ ## 0.10.7 2011-10-13
50
+
51
+ * Ruby 1.9.3 compatibility
52
+
53
+ ## 0.10.6 2011-05-22
54
+
55
+ Bugfixes
56
+ * Fix an issue on some platforms when multiple DO drivers are loaded
57
+
58
+ ## 0.10.5 2011-05-03
59
+
60
+ No changes
61
+
62
+ ## 0.10.4 2011-04-28
63
+
64
+ New features
65
+ * Add save point to transactions (all)
66
+ * JRuby 1.9 mode support (encodings etc.)
67
+
68
+ Bugfixes
69
+ * Fix bug when using nested transactions in concurrent scenarios (all)
70
+ * Use column aliases instead of names (jruby)
71
+ * DST calculation fixes (all)
72
+ * Attempt to add better support for ancient MySQL versions (do\_mysql)
73
+
74
+ Other
75
+ * Refactor to DRY up the adapters (all)
76
+ * Many style fixes
77
+ * Switch back to RSpec
78
+
79
+ ## 0.10.3 2011-01-30
80
+ * Reworked transactions
81
+ * Fix a DST bug that could cause datetimes in the wrong timezone
82
+
83
+ ## 0.10.2 2010-05-19
84
+ * Make sure Text is returned in the proper encoding
85
+ * Make Encoding.default_internal aware
86
+ * Fix insert_id if no incrementing key is used
87
+ * Rework logging for making callbacks possible
88
+ * Remove handling Object types directly
89
+
90
+ ## 0.10.1 2010-01-08
91
+
92
+ * Support for Ruby 1.8 and 1.9 on Windows.
93
+ * Switch to Jeweler for Gem building tasks (this change may be temporary).
94
+ * Switch to using Bacon for running specs: This should make specs friendlier to
95
+ new Ruby implementations that are not yet 100% MRI-compatible, and in turn,
96
+ pave the road for our own IronRuby and MacRuby support.
97
+ * Switch to the newly added rake-compiler `JavaExtensionTask` for compiling
98
+ JRuby extensions, instead of our (broken) home-grown solution.
99
+
100
+ ## 0.10.0 2009-09-15
101
+ * Improvements
102
+ * JRuby Support (using *do_jdbc*)
103
+
104
+ ## 0.9.12 2009-05-17
105
+ * Improvements
106
+ * Windows support
107
+
108
+ ## 0.9.11 2009-01-19
109
+ * Improvements
110
+ * Ruby 1.9 support
111
+ * Fixes
112
+ * Reconnecting now works properly
113
+
114
+ ## 0.9.9 2008-11-27
115
+ * Improvements
116
+ * Added initial support for Ruby 1.9 [John Harrison]
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2007 - 2011 Yehuda Katz, Dirkjan Bussink
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,100 @@
1
+ # do_mysql
2
+
3
+ * <http://dataobjects.info>
4
+
5
+ ## Description
6
+
7
+ A MySQL driver for DataObjects.
8
+
9
+ ## Features/Problems
10
+
11
+ This driver implements the DataObjects API for the MySQL relational database.
12
+
13
+ ## Synopsis
14
+
15
+ An example of usage:
16
+
17
+ ```ruby
18
+ # default user (root, no password); default port (3306)
19
+ DataObjects::Connection.new("mysql://host/database")
20
+ # specified user, specified port
21
+ DataObjects::Connection.new("mysql://user:pass@host:8888/database")
22
+
23
+ @connection = DataObjects::Connection.new("mysql://localhost/employees")
24
+ @reader = @connection.create_command('SELECT * FROM users').execute_reader
25
+ @reader.next!
26
+ ```
27
+
28
+ ## Requirements
29
+
30
+ This driver is provided for the following platforms:
31
+ * Ruby MRI (1.8.6/7), 1.9: tested on Linux, Mac OS X and Windows platforms.
32
+ * JRuby 1.3.1 + (1.4+ recommended).
33
+ * Rubinius (experimental).
34
+
35
+ Additionally you should have the following prerequisites:
36
+ * `data_objects` gem
37
+ * `do_jdbc` gem (shared library), if running on JRuby.
38
+
39
+ ## Install
40
+
41
+ To install the gem:
42
+
43
+ gem install do_mysql
44
+
45
+ If installing the MRI/1.9/Rubinius extension on OS X and you install a version
46
+ of MySQL that was built for only a single architecture, you will need to set
47
+ `ARCHFLAGS` appropriately:
48
+
49
+ sudo env ARCHFLAGS="-arch i386" gem install do_mysql
50
+
51
+ To compile and install from source:
52
+
53
+ * Install rake-compiler: `gem install rake-compiler`.
54
+
55
+ * For MRI/Rubinius extensions:
56
+ * Install the `gcc` compiler. On OS X, you should install XCode tools. On
57
+ Ubuntu, run `apt-get install build-essential`.
58
+ * Install Ruby and MySQL.
59
+ * Install the Ruby and MySQL development headers.
60
+ * On Debian-Linux distributions, you can install the following packages
61
+ with `apt`: `ruby-dev` `libmysqlclient15-dev`.
62
+ * If you want to cross-compile for Windows:
63
+ * Install MinGW:
64
+ * On Debian-Linux distributions, you can install the following package
65
+ with `apt`: `mingw32`.
66
+ * On OS X, this can install the following package with MacPorts: `i386-mingw32-gcc`.
67
+ * Run `rake-compiler cross-ruby`.
68
+ * Run `rake-compiler update-config`.
69
+
70
+ * Then, install this driver with `(jruby -S) rake install`.
71
+
72
+ For more information, see the MySQL driver wiki page:
73
+ <http://wiki.github.com/firespring/datamapper-do/mysql>.
74
+
75
+ ## Developers
76
+
77
+ Follow the above installation instructions. Additionally, you'll need:
78
+ * `rspec` gem for running specs.
79
+ * `YARD` gem for generating documentation.
80
+
81
+ See the DataObjects wiki for more comprehensive information on installing and
82
+ contributing to the JRuby-variant of this driver:
83
+ <http://wiki.github.com/firespring/datamapper-do/jruby>.
84
+
85
+ To run specs:
86
+
87
+ rake spec
88
+
89
+ To run specs without compiling extensions first:
90
+
91
+ rake spec_no_compile
92
+
93
+ To run individual specs:
94
+
95
+ rake spec SPEC=spec/connection_spec.rb
96
+
97
+ ## License
98
+
99
+ This code is licensed under an **MIT (X11) License**. Please see the
100
+ accompanying `LICENSE` file.
data/Rakefile ADDED
@@ -0,0 +1,25 @@
1
+ require 'pathname'
2
+ require 'rubygems'
3
+ require 'bundler'
4
+ require 'rubygems/package_task'
5
+ Bundler::GemHelper.install_tasks
6
+
7
+ require 'rake'
8
+ require 'rake/clean'
9
+
10
+ ROOT = Pathname(__FILE__).dirname.expand_path
11
+
12
+ # rubocop:disable Style/StringConcatenation
13
+ require ROOT + 'lib/do_mysql/version'
14
+ # rubocop:enable Style/StringConcatenation
15
+
16
+ SUDO = 'sudo' unless ENV['SUDOLESS']
17
+ BINARY_VERSION = '5.1.65'.freeze
18
+
19
+ CLEAN.include(%w({tmp,pkg}/ **/*.{o,so,bundle,jar,log,a,gem,dSYM,obj,pdb,exp,DS_Store,rbc,db} ext/do_mysql/Makefile
20
+ ext-java/target))
21
+
22
+
23
+ # TODO: Workaround for old rspec version
24
+
25
+ FileList['tasks/**/*.rake'].each { |task| import task }
@@ -0,0 +1,55 @@
1
+ #ifndef RUBY_COMPAT_H
2
+ #define RUBY_COMPAT_H
3
+
4
+ /*
5
+ * Rules for better ruby C extensions:
6
+ *
7
+ * Never use the R<TYPE> macros directly, always use R<TYPE>_<FIELD>
8
+ *
9
+ * Never compare with RBASIC(obj)->klass, always use
10
+ * rb_obj_is_instance_of()
11
+ *
12
+ * Never use RHASH(obj)->tbl or RHASH_TBL().
13
+ *
14
+ */
15
+
16
+
17
+ // Array
18
+ #ifndef RARRAY_PTR
19
+ #define RARRAY_PTR(obj) RARRAY(obj)->ptr
20
+ #endif
21
+
22
+ #ifndef RARRAY_LEN
23
+ #define RARRAY_LEN(obj) RARRAY(obj)->len
24
+ #endif
25
+
26
+ // String
27
+ #ifndef RSTRING_PTR
28
+ #define RSTRING_PTR(obj) RSTRING(obj)->ptr
29
+ #endif
30
+
31
+ #ifndef RSTRING_LEN
32
+ #define RSTRING_LEN(obj) RSTRING(obj)->len
33
+ #endif
34
+
35
+ #ifndef rb_str_ptr
36
+ #define rb_str_ptr(str) RSTRING_PTR(str)
37
+ #endif
38
+
39
+ #ifndef rb_str_ptr_readonly
40
+ #define rb_str_ptr_readonly(str) RSTRING_PTR(str)
41
+ #endif
42
+
43
+ #ifndef rb_str_flush
44
+ #define rb_str_flush(str)
45
+ #endif
46
+
47
+ #ifndef rb_str_update
48
+ #define rb_str_update(str)
49
+ #endif
50
+
51
+ #ifndef rb_str_len
52
+ #define rb_str_len(str) RSTRING_LEN(str)
53
+ #endif
54
+
55
+ #endif