You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Massimo Manghi <ma...@biol.unipr.it> on 2005/03/17 10:56:50 UTC
error using mysqltcl
I have a rivet script i wrote adapting another mod_dtcl program
that i used to manipulate simple database tables. It didn't
use the DIO interface and i went for mysqltcl instead.
The script fails to use the 'mysqlcol' command in order to collect info
about a table.
I extracted from the rivet script an example
package require mysqltcl
set dbHost localhost
set dbUser manghi
set dbPasswd Valli
set mydb [mysqlconnect -host $dbHost -u $dbUser -password $dbPasswd]
mysqluse $mydb dipartimento
set tblInfo [mysqlcol $mydb macchina name type length]
foreach i $tblInfo {
puts "==> $i"
}
runs as expected under tclsh. When sourced
into a .rvt file this is the output on the browser
mysqlcol: column 'ip' has weird datatype
while executing
"mysqlcol $mydb macchina name type length"
invoked from within
"set tblInfo [mysqlcol $mydb macchina name type length]"
'ip' is the name of the first column in the table 'macchina'
Is there any hidden processing of the list tblInfo?
--
-- Massimo Manghi
-- Dipartimento di Biologia Evolutiva e Funzionale
-- Università degli Studi di Parma
-- Parco Area delle Scienze 11A - 43100 Parma
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: error using mysqltcl
Posted by "David N. Welton" <da...@dedasys.com>.
Massimo Manghi <ma...@biol.unipr.it> writes:
> David N. Welton wrote:
> >Hrm. This is bizarre... I don't see why it should do anything
> >differently. You might try simulating Rivet conditions as much as
> >possible by running the script in a namespace in a normal Tcl
> >script.
> >I prefer Postgres myself, and find it works just fine under Rivet,
> >but that's not much help...
> for test purposes do you suggest some particular namespace after
> some 'package require ...' (for instance some namespace of a package
> yanked in by rivet)?
Rivet pages - the .rvt ones, not .tcl ones - run in a ::request
namespace. No idea if that could affect things in any way, but it's
one possibility.
> It seems the offending command is 'mysqlcol' only. Tailoring the
> script on a specific table makes the code functional again.
Very weird:-(
> I tried to change the arguments to mysqlcol: removing 'type' is ok,
> no errors, but the 'length' argument returns a list of '0', whereas
> under tclsh the column lengths are returned correctly. It's clearly
> a strange mysqltcl-rivet interference.
I'm afraid I'm at a bit of a loss, and don't have a Rivet/Mysql system
to test on. You could try asking the mysqltcl guys, or CC'ing them -
perhaps they have some ideas as to what might be going on.
In other, unrelated good news, check this out:
http://www.redomino.com/Press/News/Nuovosito/view
Some good publicity for Rivet in Italy:-)
Ciao,
--
David N. Welton
- http://www.dedasys.com/davidw/
Apache, Linux, Tcl Consulting
- http://www.dedasys.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: error using mysqltcl
Posted by Massimo Manghi <ma...@biol.unipr.it>.
David N. Welton wrote:
>
>
>Hrm. This is bizarre... I don't see why it should do anything
>differently. You might try simulating Rivet conditions as much as
>possible by running the script in a namespace in a normal Tcl script.
>
>I prefer Postgres myself, and find it works just fine under Rivet, but
>that's not much help...
>
>
>
for test purposes do you suggest some particular namespace
after some 'package require ...' (for instance some namespace
of a package yanked in by rivet)?
It seems the offending command is 'mysqlcol' only.
Tailoring the script on a specific table makes the code functional again.
I tried to change the arguments to mysqlcol: removing 'type' is ok, no
errors,
but the 'length' argument returns a list of '0', whereas under tclsh the
column
lengths are returned correctly. It's clearly a strange mysqltcl-rivet
interference.
--
-- Massimo Manghi
-- Dipartimento di Biologia Evolutiva e Funzionale
-- Università degli Studi di Parma
-- Parco Area delle Scienze 11A - 43100 Parma
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: error using mysqltcl
Posted by "David N. Welton" <da...@dedasys.com>.
Massimo Manghi <ma...@biol.unipr.it> writes:
> I have a rivet script i wrote adapting another mod_dtcl program that
> i used to manipulate simple database tables. It didn't use the DIO
> interface and i went for mysqltcl instead. The script fails to use
> the 'mysqlcol' command in order to collect info about a table.
> I extracted from the rivet script an example
> package require mysqltcl
> set dbHost localhost
> set dbUser manghi
> set dbPasswd Valli
> set mydb [mysqlconnect -host $dbHost -u $dbUser -password $dbPasswd]
> mysqluse $mydb dipartimento
> set tblInfo [mysqlcol $mydb macchina name type length]
>
> foreach i $tblInfo {
> puts "==> $i"
> }
> runs as expected under tclsh. When sourced
> into a .rvt file this is the output on the browser
>
> mysqlcol: column 'ip' has weird datatype
> while executing
> "mysqlcol $mydb macchina name type length"
> invoked from within
> "set tblInfo [mysqlcol $mydb macchina name type length]"
> 'ip' is the name of the first column in the table 'macchina' Is
> there any hidden processing of the list tblInfo?
Hrm. This is bizarre... I don't see why it should do anything
differently. You might try simulating Rivet conditions as much as
possible by running the script in a namespace in a normal Tcl script.
I prefer Postgres myself, and find it works just fine under Rivet, but
that's not much help...
--
David N. Welton
- http://www.dedasys.com/davidw/
Apache, Linux, Tcl Consulting
- http://www.dedasys.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org