From: tonyg <tonythegair@googlemail.com>
Subject: Re: mysql , gnade and function hanging
Date: Thu, 1 Jul 2010 03:19:58 -0700 (PDT)
Date: 2010-07-01T03:19:58-07:00 [thread overview]
Message-ID: <c31aa969-9169-4b95-bd28-51608fdce7f1@a30g2000yqn.googlegroups.com> (raw)
In-Reply-To: 964f5797-eac0-4a2c-9930-fc6137efc8df@w12g2000yqj.googlegroups.com
On Jul 1, 10:44 am, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
> tonyg wrote on comp.lang.ada:
>
>
>
> > I've sanistised this source of the password and ip address
>
> > with GNU.DB.MySQL;
> > with GNU.DB;
> > use GNU.DB.MySQL;
> > use GNU.DB;
> > with Ada.Text_Io; use Ada.Text_Io;
> > with Ada.Strings.Unbounded;
> > use Ada.Strings.Unbounded;
>
> > procedure trymysql is
>
> > TheDatabase : MySQL.Object;
> > TheQuery : MySQL.Query_Id;
> > TheField : MYSQL.Field_Number;
> > begin
> > Initialize(TheDatabase);
> > User (TheDatabase, "heating");
> > Password (TheDatabase,"");
> > Connect (TheDatabase,"");
> > Select_DB (TheDatabase, "heating");
>
> > TheQuery := Query (TheDatabase, "select * from userid ");
> > TheField := Get_Field_Number (TheDatabase, TheQuery, "email");
>
> > put_line ("Number of Rows :" &
> > Integer'Image(Nbr_of_Rows(TheDatabase,TheQuery)));
>
> > put_line (" Field Number of Email field : " &
> > Integer'Image(TheField));
>
> > Put_Line(Natural'image (Get_Field_Length(TheDatabase,TheQuery,
> > 1)));
> > Put_Line(Field_Type'image(Get_Field_Type(TheDatabase,TheQuery,
> > 1)));
>
> > Put_Line(To_String(String_Field (TheDatabase, TheQuery,
> > "email")));
> > end trymysql;
>
> > Out put is
>
> > tony@tony-laptop:~/snugbug/main/adastuff/heating/src$ ./trymysql
> > Number of Rows : 4
> > Field Number of Email field : 1
> > 14
>
> > raised CONSTRAINT_ERROR : gnu-db-mysql.adb:883 invalid data
> > tony@tony-laptop:~/snugbug/main/adastuff/heating/src$
>
> > Other information is that the email field in the database table is a
> > VARCHAR(80) and a primary key
>
> It seems the exception is not raised in the String_Field line as you
> initially said, but in the previous line that calls Get_Field_Type
> directly (String_Field also calls Get_Field_Type). The exception
> message "invalid data" indicates an uninitialized variable. At first I
> thought this would be the TheQuery (of type Query_ID) but now I'm not
> so sure anymore. I suggest you run this small program in a debugger
> and inspect all the parameters passed to Get_Field_Type.
>
> I do not use gnade myself, or MySQL. I no longer maintain gnade in
> Debian; Stephe Leake took over and dropped support fro MySQL because
> it was out of sync with recent versions of MySQL. So that, in fact,
> might be the cause of your problems.
>
> What platform do you use?
> What version of gnade?
> What version of MySQL?
>
> Maybe you should use the ODBC interface instead; it is more stable
> than the MySQL-specific API.
>
> --
> Ludovic Brenta.
Thanks for your help Ludovic, I'll try the odbc or another binding.
next prev parent reply other threads:[~2010-07-01 10:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-30 8:34 mysql , gnade and function hanging tonyg
2010-06-30 9:00 ` Ludovic Brenta
2010-06-30 9:03 ` tonyg
2010-06-30 9:23 ` Ludovic Brenta
2010-06-30 9:29 ` tonyg
2010-06-30 9:40 ` tonyg
2010-06-30 12:20 ` Ludovic Brenta
2010-06-30 12:53 ` tonyg
2010-07-01 9:44 ` Ludovic Brenta
2010-07-01 10:19 ` tonyg [this message]
2010-07-01 13:38 ` J-P. Rosen
2010-07-02 8:45 ` tonyg
[not found] ` <zOmdnev0COPcfLPRnZ2dnUVZ_hMAAAAA@earthlink.com>
2010-07-03 10:07 ` Dmitry A. Kazakov
2010-07-05 9:18 ` tonyg
2010-07-01 11:38 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox