[fqdb-dev] Fwd: fqdb and mysql |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/fqdb-dev Archives
]
- To: fqdb-dev@xxxxxxxxxxxxxxxxxxx
- Subject: [fqdb-dev] Fwd: fqdb and mysql
- From: Tim Raymund <tim.raymund@xxxxxxxxx>
- Date: Tue, 1 Dec 2009 08:55:40 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9Jh5LgaiPiID74bw+JbblrVot03jyq3prY0RV2MQ63Q=; b=i3sCtm0Vr1PPvSAepFXdPM+zRs6FvGWy1EfmShhMEeEc8ycEpw5MKJ5aIHGJmvelqM nRuONlJSSTCHP0NoaVSZ+k1Pxw1igIKmM9DIHJMQejBi/xJU2awWFrwz8VRycX4is4cK drQS06EVHKDLiXoSRXF4Rm5d8FGrveo0JVubI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=kwwf7lkOwvukpf07FfiwwSpNObNGXONkYXxdP10R++Ms06yHk0T0lcN8xxVF22sZZT yvGxn0FqVFb06o5AHFC69HH6MphbG1ERLAbMjPG0mrcyJdclw7ugQWvm0llE/g5XO+zC vjFT4LbxiP5kbpBPfEvBcWxZk/6JToBByTW9c=
---------- Forwarded message ----------
From: Tim Raymund <tim.raymund@xxxxxxxxx>
Date: Tue, Dec 1, 2009 at 8:54 AM
Subject: Re: fqdb and mysql
To: Erik Colson <eco@xxxxxxxxxxx>
Erik,
The OS is Fedora Core 11 where uname -a reports
Linux deimos 2.6.30.9-96.fc11.i686.PAE #1 SMP Tue Nov 3 23:41:33 EST
2009 i686 i686 i386 GNU/Linux
and mysql --version reports
mysql Ver 14.14 Distrib 5.1.37, for redhat-linux-gnu (i386) using readline 5.1
The rpm is mysql-5.1.37-1.fc11.i586.
I'm happy to test! I appreciate the work you've done!
One other thing: Perl complains that $line on line 173 of QuoteDB.pm
is used in a comparison before it's initialized. The variable is
declared on line 167, but given no initial value. Any suggestions?
Cheers!
tim.
On Tue, Dec 1, 2009 at 1:29 AM, Erik Colson <eco@xxxxxxxxxxx> wrote:
> Tim Raymund wrote:
>>
>> The first complaint about marketID seems to be related to having
>> DEFAULT '0' and AUTO_INCREMENT invoked on the same line. I removed
>> DEFAULT '0' in the spec for marketID in FQMarket.pm, but I've no idea
>> if this is the right thing to do. See here for a brief reference:
>>
>> http://www.webmasterworld.com/databases_sql_mysql/3440204.htm
>>
>> The second complaint about fqfailover is silenced by replacing 'FAIL'
>> with '0' in Symbol.pm.
>>
>> The third complaint about date is silenced by replacing the default
>> value of '' with '0000-00-00' in Quote.pm
>>
>> tim.
>>
>>
>>
>> On Mon, Nov 30, 2009 at 8:52 PM, Tim Raymund <tim.raymund@xxxxxxxxx>
>> wrote:
>>
>>>
>>> Hi,
>>>
>>> I'm having trouble using fqdb to create a database in mysql
>>>
>>> fqdb createdb --dsn='DBI:mysql:database=test;host=tobymac'
>>>
>>>
>>> The result (see below) seems to say that mysql does not like the
>>> default value of 0 for marketID. I'm happy to help and will start
>>> poking around a bit myself. Please let me know if you have any
>>> questions or suggestions.
>>>
>>> Cheers!
>>> tim.
>>>
>>>
>>> [fatshark@tobymac Desktop]$ fqdb createdb
>>> --dsn='DBI:mysql:database=test;host=tobymac'
>>> Finance::QuoteDB Copyright (C) 2008 Erik Colson
>>> This program comes with ABSOLUTELY NO WARRANTY; for details type `fqdb
>>> -w'.
>>> This is free software, and you are welcome to redistribute it
>>> under certain conditions; type `fqdb -c' for details.
>>> DBIx::Class::Schema::deploy(): DBI Exception: DBD::mysql::db do
>>> failed: Invalid default value for 'marketID' [for Statement "
>>> CREATE TABLE `FQMarket` (
>>> `marketID` integer NOT NULL DEFAULT '0' auto_increment,
>>> `name` varchar(20) NOT NULL DEFAULT '',
>>> PRIMARY KEY (`marketID`)
>>> ) ENGINE=InnoDB"] at
>>> /usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
>>> (running "
>>> CREATE TABLE `FQMarket` (
>>> `marketID` integer NOT NULL DEFAULT '0' auto_increment,
>>> `name` varchar(20) NOT NULL DEFAULT '',
>>> PRIMARY KEY (`marketID`)
>>> ) ENGINE=InnoDB") at
>>> /usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
>>> DBIx::Class::Schema::deploy(): DBI Exception: DBD::mysql::db do
>>> failed: Invalid default value for 'fqfailover' [for Statement "
>>> CREATE TABLE `symbol` (
>>> `symbolID` varchar(20) NOT NULL DEFAULT '',
>>> `fqmarket` integer DEFAULT '0',
>>> `fqsymbol` varchar(20) NOT NULL DEFAULT '',
>>> `fqfailover` enum('0','1') NOT NULL DEFAULT 'FALSE',
>>> `name` varchar(40) DEFAULT '',
>>> `isin` varchar(12) DEFAULT '',
>>> `currency` varchar(4) DEFAULT '',
>>> INDEX symbol_idx_fqmarket (`fqmarket`),
>>> PRIMARY KEY (`symbolID`),
>>> CONSTRAINT `symbol_fk_fqmarket` FOREIGN KEY (`fqmarket`) REFERENCES
>>> `FQMarket` (`marketID`) ON DELETE CASCADE ON UPDATE CASCADE
>>> ) ENGINE=InnoDB"] at
>>> /usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
>>> (running "
>>> CREATE TABLE `symbol` (
>>> `symbolID` varchar(20) NOT NULL DEFAULT '',
>>> `fqmarket` integer DEFAULT '0',
>>> `fqsymbol` varchar(20) NOT NULL DEFAULT '',
>>> `fqfailover` enum('0','1') NOT NULL DEFAULT 'FALSE',
>>> `name` varchar(40) DEFAULT '',
>>> `isin` varchar(12) DEFAULT '',
>>> `currency` varchar(4) DEFAULT '',
>>> INDEX symbol_idx_fqmarket (`fqmarket`),
>>> PRIMARY KEY (`symbolID`),
>>> CONSTRAINT `symbol_fk_fqmarket` FOREIGN KEY (`fqmarket`) REFERENCES
>>> `FQMarket` (`marketID`) ON DELETE CASCADE ON UPDATE CASCADE
>>> ) ENGINE=InnoDB") at
>>> /usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
>>> DBIx::Class::Schema::deploy(): DBI Exception: DBD::mysql::db do
>>> failed: Invalid default value for 'date' [for Statement "
>>> CREATE TABLE `quote` (
>>> `symbolID` varchar(20) NOT NULL DEFAULT '',
>>> `date` date NOT NULL DEFAULT '',
>>> `previous_close` float DEFAULT '0',
>>> `day_open` float DEFAULT '0',
>>> `day_high` float DEFAULT '0',
>>> `day_low` float DEFAULT '0',
>>> `day_close` float DEFAULT '0',
>>> `bid` integer DEFAULT '0',
>>> `ask` integer DEFAULT '0',
>>> `volume` integer DEFAULT '0',
>>> INDEX quote_idx_symbolID (`symbolID`),
>>> PRIMARY KEY (`symbolID`, `date`),
>>> CONSTRAINT `quote_fk_symbolID` FOREIGN KEY (`symbolID`) REFERENCES
>>> `symbol` (`symbolID`) ON DELETE CASCADE ON UPDATE CASCADE
>>> ) ENGINE=InnoDB"] at
>>> /usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
>>> (running "
>>> CREATE TABLE `quote` (
>>> `symbolID` varchar(20) NOT NULL DEFAULT '',
>>> `date` date NOT NULL DEFAULT '',
>>> `previous_close` float DEFAULT '0',
>>> `day_open` float DEFAULT '0',
>>> `day_high` float DEFAULT '0',
>>> `day_low` float DEFAULT '0',
>>> `day_close` float DEFAULT '0',
>>> `bid` integer DEFAULT '0',
>>> `ask` integer DEFAULT '0',
>>> `volume` integer DEFAULT '0',
>>> INDEX quote_idx_symbolID (`symbolID`),
>>> PRIMARY KEY (`symbolID`, `date`),
>>> CONSTRAINT `quote_fk_symbolID` FOREIGN KEY (`symbolID`) REFERENCES
>>> `symbol` (`symbolID`) ON DELETE CASCADE ON UPDATE CASCADE
>>> ) ENGINE=InnoDB") at
>>> /usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
>>> [fatshark@tobymac Desktop]$
>>>
>>>
>>
>>
>
> Hi Tim,
>
> Cool to have you as a new tester :)
>
> I see you're on perl 5.10.1, but can't figure the mysql version and the OS.
> Would you mind reporting these ? That may help for testing...
>
> Thanks for the help !
>
> --
> Erik Colson
>
> http://www.ecocode.net
>
>