mysql 2.5.1
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.
- data/COPYING +56 -0
- data/COPYING.ja +51 -0
- data/README.html +725 -0
- data/README_ja.html +897 -0
- data/extconf.rb +67 -0
- data/mysql-compat.rb +62 -0
- data/mysql-ruby-2.5.1.gem +0 -0
- data/mysql-ruby.gemspec +20 -0
- data/mysql.c.in +1267 -0
- data/t/00connect.rb +1 -0
- data/t/10create_db.rb +3 -0
- data/t/20create_table.rb +1 -0
- data/t/30insert.rb +2 -0
- data/t/40select.rb +4 -0
- data/t/50update.rb +2 -0
- data/t/60drop_table.rb +1 -0
- data/t/70drop_db.rb +2 -0
- data/t/80close.rb +1 -0
- data/test.rb +33 -0
- data/tommy.css +128 -0
- metadata +57 -0
data/COPYING
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the GPL
|
3
|
+
(see the file GPL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a) distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b) accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c) give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d) make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
data/COPYING.ja
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
$BK\%W%m%0%i%`$O%U%j!<%=%U%H%&%'%"$G$9!%(BGPL(the GNU General
|
2
|
+
Public License)$B$^$?$O0J2<$K<($9>r7o$GK\%W%m%0%i%`$r:FG[I[$G(B
|
3
|
+
$B$-$^$9!%(BGPL$B$K$D$$$F$O(BGPL$B%U%!%$%k$r;2>H$7$F2<$5$$!%(B
|
4
|
+
|
5
|
+
1. $BJ#@=$O@)8B$J$/<+M3$G$9!%(B
|
6
|
+
|
7
|
+
2. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$N%=!<%9$r(B
|
8
|
+
$B<+M3$KJQ99$G$-$^$9!%(B
|
9
|
+
|
10
|
+
(a) $B%M%C%H%K%e!<%:$K%]%9%H$7$?$j!$:n<T$KJQ99$rAwIU$9$k(B
|
11
|
+
$B$J$I$NJ}K!$G!$JQ99$r8x3+$9$k!%(B
|
12
|
+
|
13
|
+
(b) $BJQ99$7$?K\%W%m%0%i%`$r<+J,$N=jB0$9$kAH?%FbIt$@$1$G(B
|
14
|
+
$B;H$&!%(B
|
15
|
+
|
16
|
+
(c) $BJQ99E@$rL@<($7$?$&$(!$%=%U%H%&%'%"$NL>A0$rJQ99$9$k!%(B
|
17
|
+
$B$=$N%=%U%H%&%'%"$rG[I[$9$k;~$K$OJQ99A0$NK\%W%m%0%i(B
|
18
|
+
$B%`$bF1;~$KG[I[$9$k!%$^$?$OJQ99A0$NK\%W%m%0%i%`$N%=!<(B
|
19
|
+
$B%9$NF~<jK!$rL@<($9$k!%(B
|
20
|
+
|
21
|
+
(d) $B$=$NB>$NJQ99>r7o$r:n<T$H9g0U$9$k!%(B
|
22
|
+
|
23
|
+
3. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$r%3%s%Q%$(B
|
24
|
+
$B%k$7$?%*%V%8%'%/%H%3!<%I$d<B9T7A<0$G$bG[I[$G$-$^$9!%(B
|
25
|
+
|
26
|
+
(a) $B%P%$%J%j$r<u$1<h$C$??M$,%=!<%9$rF~<j$G$-$k$h$&$K!$(B
|
27
|
+
$B%=!<%9$NF~<jK!$rL@<($9$k!%(B
|
28
|
+
|
29
|
+
(b) $B5!3#2DFI$J%=!<%9%3!<%I$rE:IU$9$k!%(B
|
30
|
+
|
31
|
+
(c) $BJQ99$r9T$C$?%P%$%J%j$OL>A0$rJQ99$7$?$&$(!$%*%j%8%J(B
|
32
|
+
$B%k$N%=!<%9%3!<%I$NF~<jK!$rL@<($9$k!%(B
|
33
|
+
|
34
|
+
(d) $B$=$NB>$NG[I[>r7o$r:n<T$H9g0U$9$k!%(B
|
35
|
+
|
36
|
+
4. $BB>$N%W%m%0%i%`$X$N0zMQ$O$$$+$J$kL\E*$G$"$l<+M3$G$9!%$?(B
|
37
|
+
$B$@$7!$K\%W%m%0%i%`$K4^$^$l$kB>$N:n<T$K$h$k%3!<%I$O!$$=(B
|
38
|
+
$B$l$>$l$N:n<T$N0U8~$K$h$k@)8B$,2C$($i$l$k>l9g$,$"$j$^$9!%(B
|
39
|
+
|
40
|
+
$B$=$l$i%U%!%$%k$N0lMw$H$=$l$>$l$NG[I[>r7o$J$I$KIU$$$F$O(B
|
41
|
+
LEGAL$B%U%!%$%k$r;2>H$7$F$/$@$5$$!%(B
|
42
|
+
|
43
|
+
5. $BK\%W%m%0%i%`$X$NF~NO$H$J$k%9%/%j%W%H$*$h$S!$K\%W%m%0%i(B
|
44
|
+
$B%`$+$i$N=PNO$N8"Mx$OK\%W%m%0%i%`$N:n<T$G$O$J$/!$$=$l$>(B
|
45
|
+
$B$l$NF~=PNO$r@8@.$7$??M$KB0$7$^$9!%$^$?!$K\%W%m%0%i%`$K(B
|
46
|
+
$BAH$_9~$^$l$k$?$a$N3HD%%i%$%V%i%j$K$D$$$F$bF1MM$G$9!%(B
|
47
|
+
|
48
|
+
6. $BK\%W%m%0%i%`$OL5J]>Z$G$9!%:n<T$OK\%W%m%0%i%`$r%5%]!<%H(B
|
49
|
+
$B$9$k0U;V$O$"$j$^$9$,!$%W%m%0%i%`<+?H$N%P%0$"$k$$$OK\%W(B
|
50
|
+
$B%m%0%i%`$N<B9T$J$I$+$iH/@8$9$k$$$+$J$kB;32$KBP$7$F$b@U(B
|
51
|
+
$BG$$r;}$A$^$;$s!%(B
|
data/README.html
ADDED
@@ -0,0 +1,725 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<!-- $Id: README.html,v 1.3 2004/09/20 12:22:42 tommy Exp $ -->
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="content-style-type" content="text/css">
|
6
|
+
<link rel=stylesheet type="text/css" href="tommy.css">
|
7
|
+
<link rev=made href="mailto:tommy@tmtm.org">
|
8
|
+
<title>MySQL/Ruby</title>
|
9
|
+
</head>
|
10
|
+
|
11
|
+
<body>
|
12
|
+
<h1>MySQL/Ruby</h1>
|
13
|
+
<p><a href="README_ja.html">[Japanese]</a></p>
|
14
|
+
<hr>
|
15
|
+
<p>
|
16
|
+
This is the <a href="http://www.mysql.com">MySQL</a> API module for Ruby.
|
17
|
+
It provides the same functions for Ruby programs that the MySQL C API provides for C programs.
|
18
|
+
</p>
|
19
|
+
|
20
|
+
<h2>Requirement</h2>
|
21
|
+
<ul>
|
22
|
+
<li>MySQL 3.23.58 +
|
23
|
+
<li>Ruby 1.6.8 +
|
24
|
+
</ul>
|
25
|
+
<p>
|
26
|
+
The module may work for other versions, but that has not been verified.
|
27
|
+
</p>
|
28
|
+
|
29
|
+
<h2>License</h2>
|
30
|
+
<p>
|
31
|
+
This program is under <a href="http://www.ruby-lang.org/en/LICENSE.txt">Ruby's license</a>.
|
32
|
+
</p>
|
33
|
+
|
34
|
+
<h2>Install</h2>
|
35
|
+
<p>
|
36
|
+
1st:
|
37
|
+
</p>
|
38
|
+
<pre class="code">
|
39
|
+
% ruby extconf.rb
|
40
|
+
</pre>
|
41
|
+
<p>
|
42
|
+
or
|
43
|
+
</p>
|
44
|
+
<pre class="code">
|
45
|
+
% ruby extconf.rb --with-mysql-dir=/usr/local/mysql
|
46
|
+
</pre>
|
47
|
+
<p>
|
48
|
+
or
|
49
|
+
</p>
|
50
|
+
<pre clas="code">
|
51
|
+
% ruby extconf.rb --with-mysql-config
|
52
|
+
</pre>
|
53
|
+
<p>
|
54
|
+
then
|
55
|
+
</p>
|
56
|
+
<pre>
|
57
|
+
% make
|
58
|
+
</pre>
|
59
|
+
<p>
|
60
|
+
extconf.rb has following options:
|
61
|
+
</p>
|
62
|
+
<dl>
|
63
|
+
<dt>--with-mysql-include=<i>dir</i>
|
64
|
+
<dd>
|
65
|
+
MySQL header file directory. Default is /usr/local/include.
|
66
|
+
|
67
|
+
<dt>--with-mysql-lib=<i>dir</i>
|
68
|
+
<dd>
|
69
|
+
MySQL library directory. Default is /usr/local/lib.
|
70
|
+
|
71
|
+
<dt>--with-mysql-dir=<i>dir</i>
|
72
|
+
<dd>
|
73
|
+
Same as --with-mysql-include=<i>dir</i>/include,
|
74
|
+
--with-mysql-lib=<i>dir</i>/lib.
|
75
|
+
|
76
|
+
<dt>--with-mysql-config[=<i>/path/to/mysql_config</i>]
|
77
|
+
<dd>
|
78
|
+
Get compile-parameter from mysql_config command.
|
79
|
+
</dl>
|
80
|
+
<p>
|
81
|
+
2nd:
|
82
|
+
</p>
|
83
|
+
<pre class="code">
|
84
|
+
% ruby -I. ./test.rb <i>hostname</i> <i>user</i> <i>passwd</i>
|
85
|
+
</pre>
|
86
|
+
|
87
|
+
<p>
|
88
|
+
test.rb should be invoked with three arguments that indicate the
|
89
|
+
MySQL server hostname, and the username and password for a MySQL
|
90
|
+
account that can create a database named "rubytest". An
|
91
|
+
optional fourth argument is allowed, to specify a database name
|
92
|
+
to use rather than "rubytest". The database should not already
|
93
|
+
exist.
|
94
|
+
</p>
|
95
|
+
<p>
|
96
|
+
3rd:
|
97
|
+
</p>
|
98
|
+
<pre class="code">
|
99
|
+
# make install
|
100
|
+
</pre>
|
101
|
+
|
102
|
+
<h3>Note</h3>
|
103
|
+
<p>
|
104
|
+
If you get error like 'libmysqlclient not found' when testing,
|
105
|
+
you need to specify the directory in which the library is
|
106
|
+
located so that make can find it.
|
107
|
+
</p>
|
108
|
+
<pre class="code">
|
109
|
+
% env LD_RUN_PATH=<i>libmysqlclient.so directory</i> make
|
110
|
+
</pre>
|
111
|
+
|
112
|
+
<h2>Usage</h2>
|
113
|
+
<p>
|
114
|
+
The names of methods provided by this module basically are the
|
115
|
+
same as the names of the functions in the C API, except that the
|
116
|
+
Ruby method names do not begin with a 'mysql_' prefix. For
|
117
|
+
example, the Ruby query() method corresponds to the C API
|
118
|
+
mysql_query() function. For details on the use of each Ruby
|
119
|
+
method, see the descriptions of the corresponding C functions in
|
120
|
+
the MySQL Reference Manual.
|
121
|
+
</p>
|
122
|
+
<p>
|
123
|
+
Some Ruby methods may be invoked under other names that serve as
|
124
|
+
equivalent aliases, as noted below.
|
125
|
+
</p>
|
126
|
+
<p>
|
127
|
+
If an error occurs when a method executes, it raises a
|
128
|
+
Mysql::Error exception.
|
129
|
+
</p>
|
130
|
+
|
131
|
+
<h2>Mysql class</h2>
|
132
|
+
<h3>CLASS METHODS</h3>
|
133
|
+
<dl>
|
134
|
+
<dt>init()
|
135
|
+
<dd>
|
136
|
+
<p>
|
137
|
+
It return Mysql object. It not connect to mysqld.
|
138
|
+
</p>
|
139
|
+
|
140
|
+
<dt>real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
|
141
|
+
<dt>connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
|
142
|
+
<dt>new(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
|
143
|
+
<dd>
|
144
|
+
<p>
|
145
|
+
connect to mysqld and return Mysql object.
|
146
|
+
</p>
|
147
|
+
|
148
|
+
<dt>escape_string(str)
|
149
|
+
<dt>quote(str)
|
150
|
+
<dd>
|
151
|
+
<p>
|
152
|
+
quote string for insert/update.
|
153
|
+
</p>
|
154
|
+
|
155
|
+
<dt>get_client_info()
|
156
|
+
<dt>client_info()
|
157
|
+
<dd>
|
158
|
+
<p>
|
159
|
+
return client version information.
|
160
|
+
</p>
|
161
|
+
|
162
|
+
<dt>get_client_version()
|
163
|
+
<dt>client_version()
|
164
|
+
<dd>
|
165
|
+
<p>
|
166
|
+
return client version as number.
|
167
|
+
</p>
|
168
|
+
|
169
|
+
<dt>debug(str)
|
170
|
+
<dd>
|
171
|
+
<p>
|
172
|
+
same as C API mysql_debug().
|
173
|
+
</p>
|
174
|
+
</dl>
|
175
|
+
|
176
|
+
<h3>OBJECT METHODS</h3>
|
177
|
+
<dl>
|
178
|
+
<dt>options(opt, val=nil)
|
179
|
+
<dd>
|
180
|
+
<p>
|
181
|
+
same as C API mysql_options().
|
182
|
+
</p>
|
183
|
+
|
184
|
+
<dt>real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
|
185
|
+
<dt>connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
|
186
|
+
<dd>
|
187
|
+
<p>
|
188
|
+
same as Mysql.real_connect().
|
189
|
+
</p>
|
190
|
+
|
191
|
+
<dt>affected_rows()
|
192
|
+
<dd>
|
193
|
+
<p>
|
194
|
+
return affected rows.
|
195
|
+
</p>
|
196
|
+
|
197
|
+
<dt>autocommit(mode)
|
198
|
+
<dd>
|
199
|
+
<p>
|
200
|
+
set autocommit mode.
|
201
|
+
</p>
|
202
|
+
|
203
|
+
<dt>change_user(user=nil, passwd=nil, db=nil)
|
204
|
+
<dd>
|
205
|
+
<p>
|
206
|
+
change user.
|
207
|
+
</p>
|
208
|
+
|
209
|
+
<dt>character_set_name()
|
210
|
+
<dd>
|
211
|
+
<p>
|
212
|
+
return character set.
|
213
|
+
</p>
|
214
|
+
|
215
|
+
<dt>close()
|
216
|
+
<dd>
|
217
|
+
<p>
|
218
|
+
close connection.
|
219
|
+
</p>
|
220
|
+
|
221
|
+
<dt>commit()
|
222
|
+
<dd>
|
223
|
+
<p>
|
224
|
+
commit transaction.
|
225
|
+
</p>
|
226
|
+
|
227
|
+
<dt>create_db(db)
|
228
|
+
<dd>
|
229
|
+
<p>
|
230
|
+
create database.
|
231
|
+
</p>
|
232
|
+
|
233
|
+
<dt>drop_db(db)
|
234
|
+
<dd>
|
235
|
+
<p>
|
236
|
+
drop database.
|
237
|
+
</p>
|
238
|
+
|
239
|
+
<dt>dump_debug_info()
|
240
|
+
<dd>
|
241
|
+
<p>
|
242
|
+
same as C API mysql_dump_debug_info().
|
243
|
+
</p>
|
244
|
+
|
245
|
+
<dt>errno()
|
246
|
+
<dd>
|
247
|
+
<p>
|
248
|
+
return error number.
|
249
|
+
</p>
|
250
|
+
|
251
|
+
<dt>error()
|
252
|
+
<dd>
|
253
|
+
<p>
|
254
|
+
return error message.
|
255
|
+
</p>
|
256
|
+
|
257
|
+
<dt>escape_string(str)
|
258
|
+
<dt>quote(str)
|
259
|
+
<dd>
|
260
|
+
<p>
|
261
|
+
quote strings for insert/update.
|
262
|
+
same as C API mysql_real_escape_string().
|
263
|
+
</p>
|
264
|
+
|
265
|
+
<dt>field_count()
|
266
|
+
<dd>
|
267
|
+
<p>
|
268
|
+
return number of columns of last query.
|
269
|
+
</p>
|
270
|
+
|
271
|
+
<dt>get_client_info()
|
272
|
+
<dt>client_info()
|
273
|
+
<dd>
|
274
|
+
<p>
|
275
|
+
return client version information.
|
276
|
+
</p>
|
277
|
+
|
278
|
+
<dt>get_client_version()
|
279
|
+
<dt>client_version()
|
280
|
+
<dd>
|
281
|
+
<p>
|
282
|
+
return client version number.
|
283
|
+
</p>
|
284
|
+
|
285
|
+
<dt>get_host_info()
|
286
|
+
<dt>host_info()
|
287
|
+
<dd>
|
288
|
+
<p>
|
289
|
+
return connection information.
|
290
|
+
</p>
|
291
|
+
|
292
|
+
<dt>get_proto_info()
|
293
|
+
<dt>proto_info()
|
294
|
+
<dd>
|
295
|
+
<p>
|
296
|
+
return connection protocol version.
|
297
|
+
</p>
|
298
|
+
|
299
|
+
<dt>get_server_info()
|
300
|
+
<dt>server_info()
|
301
|
+
<dd>
|
302
|
+
<p>
|
303
|
+
return server version information.
|
304
|
+
</p>
|
305
|
+
|
306
|
+
<dt>get_server_version()
|
307
|
+
<dt>server_version()
|
308
|
+
<dd>
|
309
|
+
<p>
|
310
|
+
return server version number.
|
311
|
+
</p>
|
312
|
+
|
313
|
+
<dt>info()
|
314
|
+
<dd>
|
315
|
+
<p>
|
316
|
+
return information of last query.
|
317
|
+
</p>
|
318
|
+
|
319
|
+
<dt>insert_id()
|
320
|
+
<dd>
|
321
|
+
<p>
|
322
|
+
return last AUTO_INCREMENT value.
|
323
|
+
</p>
|
324
|
+
|
325
|
+
<dt>kill(id)
|
326
|
+
<dd>
|
327
|
+
<p>
|
328
|
+
kill thread.
|
329
|
+
</p>
|
330
|
+
|
331
|
+
<dt>list_dbs(db=nil)
|
332
|
+
<dd>
|
333
|
+
<p>
|
334
|
+
return database list.
|
335
|
+
</p>
|
336
|
+
|
337
|
+
<dt>list_fields(table, field=nil)
|
338
|
+
<dd>
|
339
|
+
<p>
|
340
|
+
return Mysql::Result object.
|
341
|
+
</p>
|
342
|
+
|
343
|
+
<dt>list_processes()
|
344
|
+
<dd>
|
345
|
+
<p>
|
346
|
+
return Mysql::Result object.
|
347
|
+
</p>
|
348
|
+
|
349
|
+
<dt>list_tables(table=nil)
|
350
|
+
<dd>
|
351
|
+
<p>
|
352
|
+
return table list Array.
|
353
|
+
</p>
|
354
|
+
|
355
|
+
<dt>ping()
|
356
|
+
<dd>
|
357
|
+
<p>
|
358
|
+
check server.
|
359
|
+
</p>
|
360
|
+
|
361
|
+
<dt>query(q)
|
362
|
+
<dd>
|
363
|
+
<p>
|
364
|
+
do query and store_result(). return Mysql::Result object.
|
365
|
+
If query_with_result is false, it does not store_result().
|
366
|
+
</p>
|
367
|
+
|
368
|
+
<dt>refresh(r)
|
369
|
+
<dd>
|
370
|
+
<p>
|
371
|
+
flush server log or cache.
|
372
|
+
</p>
|
373
|
+
|
374
|
+
<dt>reload()
|
375
|
+
<dd>
|
376
|
+
<p>
|
377
|
+
reload access privilege table.
|
378
|
+
</p>
|
379
|
+
|
380
|
+
<dt>rollback()
|
381
|
+
<dd>
|
382
|
+
<p>
|
383
|
+
rollback transaction.
|
384
|
+
</p>
|
385
|
+
|
386
|
+
<dt>select_db(db)
|
387
|
+
<dd>
|
388
|
+
<p>
|
389
|
+
select database.
|
390
|
+
</p>
|
391
|
+
|
392
|
+
<dt>shutdown()
|
393
|
+
<dd>
|
394
|
+
<p>
|
395
|
+
shutdown server.
|
396
|
+
</p>
|
397
|
+
|
398
|
+
<dt>ssl_set(key=nil, cert=nil, ca=nil, capath=nil, cipher=nil)
|
399
|
+
<dd>
|
400
|
+
<p>
|
401
|
+
use SSL.
|
402
|
+
</p>
|
403
|
+
|
404
|
+
<dt>stat()
|
405
|
+
<dd>
|
406
|
+
<p>
|
407
|
+
return server status.
|
408
|
+
</p>
|
409
|
+
|
410
|
+
<dt>store_result()
|
411
|
+
<dd>
|
412
|
+
<p>
|
413
|
+
return Mysql::Result object.
|
414
|
+
</p>
|
415
|
+
|
416
|
+
<dt>thread_id()
|
417
|
+
<dd>
|
418
|
+
<p>
|
419
|
+
retrun thread id.
|
420
|
+
</p>
|
421
|
+
|
422
|
+
<dt>use_result()
|
423
|
+
<dd>
|
424
|
+
<p>
|
425
|
+
return Mysql::Result object.
|
426
|
+
</p>
|
427
|
+
|
428
|
+
<dt>warning_count()
|
429
|
+
<dd>
|
430
|
+
<p>
|
431
|
+
return warning count last query.
|
432
|
+
</p>
|
433
|
+
</dl>
|
434
|
+
|
435
|
+
<h3>OBJECT VARIABLES</h3>
|
436
|
+
|
437
|
+
<dl>
|
438
|
+
<dt>query_with_result
|
439
|
+
<dd>
|
440
|
+
If it is true then do store_result() on query() If true,
|
441
|
+
query() also invokes store_result() and returns a
|
442
|
+
Mysql::Result object. Default is true.
|
443
|
+
</dl>
|
444
|
+
|
445
|
+
<h2>Mysql::Result class</h2>
|
446
|
+
|
447
|
+
<h3>OBJECT METHODS</h3>
|
448
|
+
<dl>
|
449
|
+
<dt>free()
|
450
|
+
<dd>
|
451
|
+
<p>
|
452
|
+
free memory of result table.
|
453
|
+
</p>
|
454
|
+
|
455
|
+
<dt>data_seek(offset)
|
456
|
+
<dd>
|
457
|
+
<p>
|
458
|
+
seek row.
|
459
|
+
</p>
|
460
|
+
|
461
|
+
<dt>fetch_field()
|
462
|
+
<dd>
|
463
|
+
<p>
|
464
|
+
return next Mysql::Field object.
|
465
|
+
</p>
|
466
|
+
|
467
|
+
<dt>fetch_fields()
|
468
|
+
<dd>
|
469
|
+
<p>
|
470
|
+
return Array of Mysql::Field object.
|
471
|
+
</p>
|
472
|
+
|
473
|
+
<dt>fetch_field_direct(fieldnr)
|
474
|
+
<dd>
|
475
|
+
<p>
|
476
|
+
return Mysql::Field object.
|
477
|
+
</p>
|
478
|
+
|
479
|
+
<dt>fetch_lengths()
|
480
|
+
<dd>
|
481
|
+
<p>
|
482
|
+
return Array of field length.
|
483
|
+
</p>
|
484
|
+
|
485
|
+
<dt>fetch_row()
|
486
|
+
<dd>
|
487
|
+
<p>
|
488
|
+
return row as Array.
|
489
|
+
</p>
|
490
|
+
|
491
|
+
<dt>fetch_hash(with_table=false)
|
492
|
+
<dd>
|
493
|
+
<p>
|
494
|
+
return row as Hash.
|
495
|
+
If with_table is true, hash key format is "tablename.fieldname".
|
496
|
+
</p>
|
497
|
+
|
498
|
+
<dt>field_seek(offset)
|
499
|
+
<dd>
|
500
|
+
<p>
|
501
|
+
seek field.
|
502
|
+
</p>
|
503
|
+
|
504
|
+
<dt>field_tell()
|
505
|
+
<dd>
|
506
|
+
<p>
|
507
|
+
return field position.
|
508
|
+
</p>
|
509
|
+
|
510
|
+
<dt>num_fields()
|
511
|
+
<dd>
|
512
|
+
<p>
|
513
|
+
return number of fields.
|
514
|
+
</p>
|
515
|
+
|
516
|
+
<dt>num_rows()
|
517
|
+
<dd>
|
518
|
+
<p>
|
519
|
+
return number of rows.
|
520
|
+
</p>
|
521
|
+
|
522
|
+
<dt>row_seek(offset)
|
523
|
+
<dd>
|
524
|
+
<p>
|
525
|
+
seek row.
|
526
|
+
</p>
|
527
|
+
|
528
|
+
<dt>row_tell()
|
529
|
+
<dd>
|
530
|
+
<p>
|
531
|
+
return row position.
|
532
|
+
</p>
|
533
|
+
</dl>
|
534
|
+
|
535
|
+
<h3>ITERATOR</h3>
|
536
|
+
<dl>
|
537
|
+
<dt>each() {|x| ...}
|
538
|
+
<dd>
|
539
|
+
<p>
|
540
|
+
'x' is array of column values.
|
541
|
+
</p>
|
542
|
+
|
543
|
+
<dt>each_hash(with_table=false) {|x| ...}
|
544
|
+
<dd>
|
545
|
+
<p>
|
546
|
+
'x' is hash of column values, and the keys are the column names.
|
547
|
+
</p>
|
548
|
+
</dl>
|
549
|
+
|
550
|
+
<h2>Mysql::Field class</h2>
|
551
|
+
|
552
|
+
<h3>OBJECT VARIABLES(read only)</h3>
|
553
|
+
<dl>
|
554
|
+
<dt>name<dd>field name
|
555
|
+
<dt>table<dd>table name
|
556
|
+
<dt>def<dd>default value
|
557
|
+
<dt>type<dd>field type
|
558
|
+
<dt>length<dd>field length
|
559
|
+
<dt>max_length<dd>max field length
|
560
|
+
<dt>flags<dd>field flag
|
561
|
+
<dt>decimals<dd>number of decimals
|
562
|
+
</dl>
|
563
|
+
|
564
|
+
<h3>OBJECT METHODS</h3>
|
565
|
+
<dl>
|
566
|
+
<dt>hash()
|
567
|
+
<dd>
|
568
|
+
<p>
|
569
|
+
return field as Hash.
|
570
|
+
</p>
|
571
|
+
<p>
|
572
|
+
ex.) obj.name == obj.hash['name']
|
573
|
+
</p>
|
574
|
+
|
575
|
+
<dt>is_not_null?()
|
576
|
+
<dd>
|
577
|
+
<p>
|
578
|
+
True if this field is defined as NOT NULL.
|
579
|
+
</p>
|
580
|
+
|
581
|
+
<dt>is_num?()
|
582
|
+
<dd>
|
583
|
+
<p>
|
584
|
+
True if this field type is numeric.
|
585
|
+
</p>
|
586
|
+
|
587
|
+
<dt>is_pri_key?()
|
588
|
+
<dd>
|
589
|
+
<p>
|
590
|
+
True if this field is a primary key.
|
591
|
+
</p>
|
592
|
+
|
593
|
+
<dt>inspect()
|
594
|
+
<dd>
|
595
|
+
<p>
|
596
|
+
return "#<Mysql::Field:fieldname>"
|
597
|
+
</p>
|
598
|
+
</dl>
|
599
|
+
|
600
|
+
<h2>Mysql::Error class</h2>
|
601
|
+
|
602
|
+
<h3>OBJECT VARIABLES(read only)</h3>
|
603
|
+
<dl>
|
604
|
+
<dt>error
|
605
|
+
<dd>eror message
|
606
|
+
<dt>errno
|
607
|
+
<dd>error number
|
608
|
+
</dl>
|
609
|
+
|
610
|
+
<h2>Histroy</h2>
|
611
|
+
<dl>
|
612
|
+
<dt>2004-09-20
|
613
|
+
<dd>
|
614
|
+
version 2.5.1
|
615
|
+
<ul>
|
616
|
+
<li>add Mysql#set_ssl().
|
617
|
+
</ul>
|
618
|
+
|
619
|
+
<dt>2004-08-31
|
620
|
+
<dd>
|
621
|
+
version 2.5
|
622
|
+
<ul>
|
623
|
+
<li>correspond to MySQL 4.1.x.
|
624
|
+
<li>change MysqlRes, MysqlField, MysqlError to Mysql::Result, Mysql::Field, Mysql::Error.
|
625
|
+
<li>add Mysql.client_version(), Mysql.get_client_version(),
|
626
|
+
Mysql#client_version(), Mysql#get_client_version(),
|
627
|
+
Mysql#server_version(), Mysql#get_server_version(),
|
628
|
+
Mysql#warning_count(), Mysql#commit(), Mysql#rollback(),
|
629
|
+
Mysql#autocommit().
|
630
|
+
<li>add Mysql::Field#is_not_null?(), Mysql::Field#is_pri_key?(),
|
631
|
+
Mysql::Field#is_num?().
|
632
|
+
<li>add MysqlField::TYPE_VAR_STRING.
|
633
|
+
</ul>
|
634
|
+
|
635
|
+
<dt>2003-08-10
|
636
|
+
<dd>
|
637
|
+
version 2.4.5
|
638
|
+
<ul>
|
639
|
+
<li>extconf.rb: correspond to MySQL 4.1.
|
640
|
+
<li>mysql.c.in: correspond to Ruby 1.8.
|
641
|
+
</ul>
|
642
|
+
|
643
|
+
<dt>2003-02-23
|
644
|
+
<dd>
|
645
|
+
version 2.4.4a
|
646
|
+
<ul>
|
647
|
+
<li>make extconf.rb to correspond to Ruby 1.8.0
|
648
|
+
</ul>
|
649
|
+
|
650
|
+
<dt>2003-01-29
|
651
|
+
<dd>
|
652
|
+
version 2.4.4
|
653
|
+
<ul>
|
654
|
+
<li>add Mysql::OPT_LOCAL_INFILE.
|
655
|
+
<li>add --with-mysql-config option to extconf.rb.
|
656
|
+
<li>extconf.rb automatically detect typical library.
|
657
|
+
</ul>
|
658
|
+
|
659
|
+
<dt>2003-01-05
|
660
|
+
<dd>
|
661
|
+
version 2.4.3c
|
662
|
+
<ul>
|
663
|
+
<li>modified English README. Thanks to Paul DuBois.
|
664
|
+
</ul>
|
665
|
+
|
666
|
+
<dt>2002-12-24
|
667
|
+
<dd>
|
668
|
+
version 2.4.3b
|
669
|
+
<ul>
|
670
|
+
<li>make extconf.rb to correspond to Ruby 1.6.8.
|
671
|
+
</ul>
|
672
|
+
|
673
|
+
<dt>2002-11-07
|
674
|
+
<dd>
|
675
|
+
version 2.4.3a
|
676
|
+
<ul>
|
677
|
+
<li>fix bug duplicating constant.
|
678
|
+
</ul>
|
679
|
+
|
680
|
+
<dt>2002-09-10
|
681
|
+
<dd>
|
682
|
+
version 2.4.3
|
683
|
+
<ul>
|
684
|
+
<li>for error number with prefix ER_ .
|
685
|
+
<li>get error constant from errmsg.h and mysqld_error.h automatically.
|
686
|
+
</ul>
|
687
|
+
|
688
|
+
<dt>2002-01-07
|
689
|
+
<dd>
|
690
|
+
version 2.4.2
|
691
|
+
<ul>
|
692
|
+
<li>for MySQL 4.0.
|
693
|
+
<li>change `uint' to `unsigned int' (for mswin).
|
694
|
+
</ul>
|
695
|
+
|
696
|
+
<dt>2001-12-02
|
697
|
+
<dd>
|
698
|
+
version 2.4.1
|
699
|
+
<ul>
|
700
|
+
<li>remove `extern' (for Cygiwn).
|
701
|
+
<li>change option of extconf.rb.
|
702
|
+
</ul>
|
703
|
+
|
704
|
+
<dt>2001-10-12
|
705
|
+
<dd>
|
706
|
+
version 2.4.0
|
707
|
+
<ul>
|
708
|
+
<li>for Ruby 1.7.
|
709
|
+
<li>add Mysql::debug(), Mysql#change_user(), Mysql#character_set_name(), Mysql#dump_debug_info().
|
710
|
+
</ul>
|
711
|
+
</dl>
|
712
|
+
|
713
|
+
<h2>Author</h2>
|
714
|
+
<p>
|
715
|
+
e-mail: TOMITA Masahiro <a href="mailto:tommy@tmtm.org">tommy@tmtm.org</a>
|
716
|
+
<a href="http://tmtm.org">http://tmtm.org</a>
|
717
|
+
</p>
|
718
|
+
<hr>
|
719
|
+
<address><a href="mailto:tommy@tmtm.org">TOMITA Masahiro</a></address>
|
720
|
+
<!-- Created: Sun Aug 29 11:52:09 JST 2004 -->
|
721
|
+
<!-- hhmts start -->
|
722
|
+
Last modified: Mon Sep 20 21:20:17 JST 2004
|
723
|
+
<!-- hhmts end -->
|
724
|
+
</body>
|
725
|
+
</html>
|