dbd-mysql 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dbd/Mysql.rb +1 -1
- data/lib/dbd/mysql/database.rb +7 -7
- metadata +37 -20
data/lib/dbd/Mysql.rb
CHANGED
data/lib/dbd/mysql/database.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module DBI::DBD::Mysql
|
2
2
|
#
|
3
3
|
# Models the DBI::BaseDatabase API to create DBI::DatabaseHandle objects.
|
4
|
-
#
|
4
|
+
#
|
5
5
|
class Database < DBI::BaseDatabase
|
6
6
|
include Util
|
7
7
|
|
@@ -52,7 +52,7 @@ module DBI::DBD::Mysql
|
|
52
52
|
}
|
53
53
|
|
54
54
|
|
55
|
-
#
|
55
|
+
#
|
56
56
|
# This maps type names to DBI Types.
|
57
57
|
#
|
58
58
|
TYPE_MAP = {}
|
@@ -60,7 +60,7 @@ module DBI::DBD::Mysql
|
|
60
60
|
::Mysql::Field.constants.grep(/^TYPE_/).each do |const|
|
61
61
|
mysql_type = MysqlField.const_get(const) # numeric type code
|
62
62
|
coercion_method = DBI::Type::Varchar # default coercion method
|
63
|
-
case const
|
63
|
+
case const.to_s
|
64
64
|
when 'TYPE_TINY'
|
65
65
|
mysql_type_name = 'TINYINT'
|
66
66
|
coercion_method = DBI::Type::Integer
|
@@ -111,7 +111,7 @@ module DBI::DBD::Mysql
|
|
111
111
|
'TYPE_SET',
|
112
112
|
'TYPE_BIT',
|
113
113
|
'TYPE_NULL'
|
114
|
-
mysql_type_name = const.sub(/^TYPE_/, '')
|
114
|
+
mysql_type_name = const.to_s.sub(/^TYPE_/, '')
|
115
115
|
else
|
116
116
|
mysql_type_name = 'UNKNOWN'
|
117
117
|
end
|
@@ -139,7 +139,7 @@ module DBI::DBD::Mysql
|
|
139
139
|
@have_transactions = (server_version >= 32317)
|
140
140
|
# assume that the connection begins in AutoCommit mode
|
141
141
|
@attr['AutoCommit'] = true
|
142
|
-
@mutex = Mutex.new
|
142
|
+
@mutex = Mutex.new
|
143
143
|
end
|
144
144
|
|
145
145
|
def disconnect
|
@@ -182,7 +182,7 @@ module DBI::DBD::Mysql
|
|
182
182
|
# * indexed: true if the column belongs to an index.
|
183
183
|
# * primary: true if the column is a part of a primary key.
|
184
184
|
# * unique: true if the values in this column are unique.
|
185
|
-
# * default: the default value if this column is not explicitly set.
|
185
|
+
# * default: the default value if this column is not explicitly set.
|
186
186
|
#
|
187
187
|
def columns(table)
|
188
188
|
dbh = DBI::DatabaseHandle.new(self)
|
@@ -191,7 +191,7 @@ module DBI::DBD::Mysql
|
|
191
191
|
sth.each do |row|
|
192
192
|
uniques << row[4] if row[1] == 0
|
193
193
|
end
|
194
|
-
end
|
194
|
+
end
|
195
195
|
|
196
196
|
ret = nil
|
197
197
|
dbh.execute("SHOW FIELDS FROM #{table}") do |sth|
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbd-mysql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 4
|
8
|
+
- 4
|
9
|
+
version: 0.4.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Erik Hollensbe
|
@@ -10,29 +15,35 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date:
|
18
|
+
date: 2010-03-06 00:00:00 -05:00
|
14
19
|
default_executable:
|
15
20
|
dependencies:
|
16
21
|
- !ruby/object:Gem::Dependency
|
17
22
|
name: dbi
|
18
|
-
|
19
|
-
|
20
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
21
25
|
requirements:
|
22
26
|
- - ">="
|
23
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 4
|
31
|
+
- 0
|
24
32
|
version: 0.4.0
|
25
|
-
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
26
35
|
- !ruby/object:Gem::Dependency
|
27
36
|
name: mysql
|
28
|
-
|
29
|
-
|
30
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
39
|
requirements:
|
32
40
|
- - ">="
|
33
41
|
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
34
44
|
version: "0"
|
35
|
-
|
45
|
+
type: :runtime
|
46
|
+
version_requirements: *id002
|
36
47
|
description: MySQL DBI DBD, Leverages 'mysql' low-level driver
|
37
48
|
email: ruby-dbi-users@rubyforge.org
|
38
49
|
executables: []
|
@@ -44,25 +55,27 @@ extra_rdoc_files:
|
|
44
55
|
- LICENSE
|
45
56
|
- ChangeLog
|
46
57
|
files:
|
47
|
-
- test/dbd/general/test_statement.rb
|
48
58
|
- test/dbd/general/test_database.rb
|
59
|
+
- test/dbd/general/test_statement.rb
|
49
60
|
- test/dbd/general/test_types.rb
|
61
|
+
- test/dbd/mysql/test_blob.rb
|
62
|
+
- test/dbd/mysql/test_new_methods.rb
|
63
|
+
- test/dbd/mysql/up.sql
|
50
64
|
- test/dbd/mysql/base.rb
|
51
|
-
- test/dbd/mysql/test_patches.rb
|
52
65
|
- test/dbd/mysql/down.sql
|
53
|
-
- test/dbd/mysql/
|
54
|
-
- test/dbd/mysql/test_new_methods.rb
|
55
|
-
- test/dbd/mysql/test_blob.rb
|
66
|
+
- test/dbd/mysql/test_patches.rb
|
56
67
|
- lib/dbd/Mysql.rb
|
57
|
-
- lib/dbd/mysql/database.rb
|
58
68
|
- lib/dbd/mysql/driver.rb
|
59
69
|
- lib/dbd/mysql/statement.rb
|
70
|
+
- lib/dbd/mysql/database.rb
|
60
71
|
- test/DBD_TESTS
|
61
72
|
- README
|
62
73
|
- LICENSE
|
63
74
|
- ChangeLog
|
64
75
|
has_rdoc: true
|
65
76
|
homepage: http://www.rubyforge.org/projects/ruby-dbi
|
77
|
+
licenses: []
|
78
|
+
|
66
79
|
post_install_message:
|
67
80
|
rdoc_options: []
|
68
81
|
|
@@ -72,20 +85,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
85
|
requirements:
|
73
86
|
- - ">="
|
74
87
|
- !ruby/object:Gem::Version
|
88
|
+
segments:
|
89
|
+
- 1
|
90
|
+
- 8
|
91
|
+
- 0
|
75
92
|
version: 1.8.0
|
76
|
-
version:
|
77
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
94
|
requirements:
|
79
95
|
- - ">="
|
80
96
|
- !ruby/object:Gem::Version
|
97
|
+
segments:
|
98
|
+
- 0
|
81
99
|
version: "0"
|
82
|
-
version:
|
83
100
|
requirements: []
|
84
101
|
|
85
102
|
rubyforge_project: ruby-dbi
|
86
|
-
rubygems_version: 1.3.
|
103
|
+
rubygems_version: 1.3.6
|
87
104
|
signing_key:
|
88
|
-
specification_version:
|
105
|
+
specification_version: 3
|
89
106
|
summary: MySQL DBI DBD, Leverages 'mysql' low-level driver
|
90
107
|
test_files:
|
91
108
|
- test/ts_dbd.rb
|