projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more mojo->master return path fixes
[spider.git]
/
perl
/
DXSql
/
mysql.pm
diff --git
a/perl/DXSql/mysql.pm
b/perl/DXSql/mysql.pm
index 5197adb1e454eeac7db1794c98867959809cdbc7..f5a27a0791b30e31e40ef27bfec05e3a2737dc97 100644
(file)
--- a/
perl/DXSql/mysql.pm
+++ b/
perl/DXSql/mysql.pm
@@
-3,7
+3,7
@@
#
# Stuff like table creates and (later) alters
#
#
# Stuff like table creates and (later) alters
#
-#
$Id$
+#
#
# Copyright (c) 2005 Dirk Koopman G1TLH
#
#
# Copyright (c) 2005 Dirk Koopman G1TLH
#
@@
-12,12
+12,7
@@
package DXSql::mysql;
use DXDebug;
use DXDebug;
-use vars qw($VERSION $BRANCH @ISA);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
-
+use vars qw(@ISA);
@ISA = qw{DXSql};
sub show_tables
@ISA = qw{DXSql};
sub show_tables
@@
-27,11
+22,36
@@
sub show_tables
my $sth = $self->prepare($s);
$sth->execute;
my @out;
my $sth = $self->prepare($s);
$sth->execute;
my @out;
- push @out, $sth->fetchrow_array;
+ while (my @t = $sth->fetchrow_array) {
+ push @out, @t;
+ }
$sth->finish;
return @out;
}
$sth->finish;
return @out;
}
+sub has_ipaddr
+{
+ my $self = shift;
+ my $s = q(describe spot);
+ my $sth = $self->prepare($s);
+ $sth->execute;
+ while (my @t = $sth->fetchrow_array) {
+ if ($t[0] eq 'ipaddr') {
+ $sth->finish;
+ return 1;
+ }
+ }
+ $sth->finish;
+ return undef;
+}
+
+sub add_ipaddr
+{
+ my $self = shift;
+ my $s = q(alter table spot add column ipaddr varchar(40));
+ $self->do($s);
+}
+
sub spot_create_table
{
my $self = shift;
sub spot_create_table
{
my $self = shift;
@@
-50,7
+70,8
@@
spotcq tinyint,
spotteritu tinyint,
spottercq tinyint,
spotstate char(2),
spotteritu tinyint,
spottercq tinyint,
spotstate char(2),
-spotterstate char(2)
+spotterstate char(2),
+ipaddr varchar(40)
)};
$self->do($s);
}
)};
$self->do($s);
}
@@
-58,10
+79,10
@@
spotterstate char(2)
sub spot_add_indexes
{
my $self = shift;
sub spot_add_indexes
{
my $self = shift;
- $self->do('create index spot_ix1 on spot(time desc)');
dbg('adding spot index ix1');
dbg('adding spot index ix1');
- $self->do('create index spot_ix
2 on spot(spotcall a
sc)');
+ $self->do('create index spot_ix
1 on spot(time de
sc)');
dbg('adding spot index ix2');
dbg('adding spot index ix2');
+ $self->do('create index spot_ix2 on spot(spotcall asc)');
}
}