From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fc3719e6afe93cd7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: mysql , gnade and function hanging Date: Wed, 30 Jun 2010 14:20:46 +0200 Organization: A noiseless patient Spider Message-ID: <87bpasiue9.fsf@ludovic-brenta.org> References: <9d22007e-b11c-4527-afb5-ae429aeb3f05@c10g2000yqi.googlegroups.com> <773ca91b-2bcb-4b5e-9943-605a852d4dfd@t10g2000yqg.googlegroups.com> <1be70d43-a5f2-40cc-8859-f4e5d34bcd52@w12g2000yqj.googlegroups.com> <9e8008e5-129f-4b9b-b083-44b386a7ce4b@i28g2000yqa.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Wed, 30 Jun 2010 12:20:48 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="cECppneDvOrD33hvYSxd9A"; logging-data="27996"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HTHfqhlruRTgdOaM6OWv0" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:DrqIspZgsWzMtEPuQOR4DjCPEoU= sha1:2K3UKN04cbYVQzFI6Xe/dJhNfXA= Xref: g2news2.google.com comp.lang.ada:13007 Date: 2010-06-30T14:20:46+02:00 List-Id: tonyg writes on comp.lang.ada: >>>> On 30 June, 09:34, tonyg wrote: >>>>> I am calling this gnade function in the mysql package to get some >>>>> debug info >>>>> >>>>> Put_Line(To_String(String_Field (TheDatabase, TheHeaterQuery, 1))); >>>>> >>>>> it unfortunately hangs though and the task stops >>>>> >>>>> I am thinking perhaps the whole task has either hung or terminated >>>>> without telling me. >>>>> >>>>> Would gnat tell me if this task had crashed? >>>> >>>> I put the code in a straight procedure and I get a constraint error >>>> which is >>>> >>>> raised CONSTRAINT_ERROR : gnu-db-mysql.adb:883 invalid data >>>> >>>> I am wondering what field types are good to use in a ada mysql >>>> database connection and what I am doing wrong here - has anybody any >>>> ideas ? >>>> >>> Looking at gnu-db-mysql.adb:883 (for gnade 1.6.1 or 1.6.2) indicates >>> that your variable TheHeaterQuery is not initialized. >>> >>> -- >>> Ludovic Brenta. >> >> Do you have some example code I can take a look at that retrieves a >> string from a database? > > btw I use the Nbr_Of_Rows function and I get an answer of 2 which > indicates that the query has operated and retrieved the data correctly > and I try the query out in the mysql query browser to make sure the > query works so I do think the query has correctly initialised but its > when I go to access the string that things fall over. But I am very > confused about this problem as well ... The closest thing to an example is the documentation in gnu-db-mysql.ads; have you read it? In particular, the Query_ID must be the result of calling Query and the Query_ID must not have been dropped. Without your full sources it is very difficult to diagnose your problem any further. From what you say, I have a hunch that maybe you issue the query in one task and then try to use it in another task? Don't do that :) -- Ludovic Brenta.