summaryrefslogtreecommitdiff
path: root/fml/lib/IO/Adapter/MySQL.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-01-24 09:03:55 +0000
committerfukachan <fukachan>2004-01-24 09:03:55 +0000
commitff05d890ce1e70329fff09e207acd4d11740090f (patch)
treea7d4024ed2867e73e5f94b0b696fa4b1633785fa /fml/lib/IO/Adapter/MySQL.pm
parent22441065efdc239bc5533152f7fc2a61623916c7 (diff)
downloadfml8-ff05d890ce1e70329fff09e207acd4d11740090f.tar.gz
fml8-ff05d890ce1e70329fff09e207acd4d11740090f.tar.bz2
fml8-ff05d890ce1e70329fff09e207acd4d11740090f.zip
overhaul from FNF point view.
o fix comments. o fix loop label name. o more correct initialization if could. o use //o;
Diffstat (limited to 'fml/lib/IO/Adapter/MySQL.pm')
-rw-r--r--fml/lib/IO/Adapter/MySQL.pm24
1 files changed, 13 insertions, 11 deletions
diff --git a/fml/lib/IO/Adapter/MySQL.pm b/fml/lib/IO/Adapter/MySQL.pm
index 0738cdec..f5bd1c03 100644
--- a/fml/lib/IO/Adapter/MySQL.pm
+++ b/fml/lib/IO/Adapter/MySQL.pm
@@ -1,9 +1,9 @@
#-*- perl -*-
#
-# Copyright (C) 2000,2001,2002,2003 Ken'ichi Fukamachi
+# Copyright (C) 2000,2001,2002,2003,2004 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: MySQL.pm,v 1.25 2003/02/01 10:55:04 fukachan Exp $
+# $FML: MySQL.pm,v 1.26 2003/08/23 04:35:44 fukachan Exp $
#
@@ -29,7 +29,7 @@ IO::Adapter::MySQL - interface to talk with a MySQL server
my $map = 'mysql:toymodel';
my $map_params = {
- $map => {
+ $map => {
sql_server => 'localhost',
user => 'fukachan',
user_password => 'uja',
@@ -71,7 +71,7 @@ customizatoins and functions.
=cut
-# Descriptions: initialize MySQL specific configuration
+# Descriptions: initialize MySQL specific configuration.
# Arguments: OBJ($self) HASH_REF($me) HASH_REF($args)
# Side Effects: none
# Return Value: none
@@ -87,7 +87,7 @@ sub configure
sql_table
sql_user
sql_password)) {
- $me->{ "_$key" } = $config->{ $key };
+ $me->{ "_$key" } = $config->{ $key } || '';
}
use IO::Adapter::DBI;
@@ -98,7 +98,7 @@ sub configure
});
# save the current DSN
- $me->{ _dsn } = $dsn;
+ $me->{ _dsn } = $dsn;
# save map specific configuration
$me->{ _config } = $config;
@@ -113,7 +113,7 @@ After re-opening, we moved to the specified $pos.
=cut
-# Descriptions: set position in database handle
+# Descriptions: set position in database handle.
# Arguments: OBJ($self) NUM($pos)
# Side Effects: none
# Return Value: none
@@ -145,13 +145,14 @@ sub setpos
=cut
-# Descriptions: get position in database handle
+# Descriptions: get position in database handle.
# Arguments: OBJ($self)
# Side Effects: none
# Return Value: NUM
sub getpos
{
my ($self) = @_;
+
return $self->{ _row_pos };
}
@@ -161,14 +162,15 @@ sub getpos
=cut
-# Descriptions: EOF or not?
+# Descriptions: check if EOF or not?
# Arguments: OBJ($self)
# Side Effects: none
# Return Value: 1 or 0
sub eof
{
my ($self) = @_;
- $self->{ _row_pos } < $self->{ _row_max } ? 0 : 1;
+
+ return( $self->{ _row_pos } < $self->{ _row_max } ? 0 : 1 );
}
@@ -188,7 +190,7 @@ Ken'ichi Fukamachi
=head1 COPYRIGHT
-Copyright (C) 2000,2001,2002,2003 Ken'ichi Fukamachi
+Copyright (C) 2000,2001,2002,2003,2004 Ken'ichi Fukamachi
All rights reserved. This program is free software; you can
redistribute it and/or modify it under the same terms as Perl itself.