It's caused by this wrong (old) code in the class wrapper, 
now correctly shown as argument error:

--- tmysql.prg @ 372
      ELSE
         // Should query have returned rows? (Was it a SELECT like 
query?)

         IF ( ::nNumFields := 
mysql_num_fields( nSocket ) ) == 0

           
 // Was not a SELECT so reset ResultHandle changed by previous 
mysql_store_result()
            ::nResultHandle := NIL

         ELSE
            ::lError := .T.

         ENDIF
      ENDIF
---

As you can see, wrong object is passed to MYSQL_NUM_FIELDS(), 
which was so far was silently ignored.

I can't tell 
what the original author wanted to do here, but I can clean 
it to work as before, which means not to return error, but silently do 
nothing.

Brgds,
Viktor


On Sat, 
Feb 27, 2010 at 11:28 AM, Mitja Podgornik <yamam...@rocketmail.com> wrote:

Hi, 
>Victor
>
>>In Your recent modification of mysql.c this system error occurs when 
>>attempting to 
>execute some commands:
>
>>Argument error: MYSQL_NUM_FIELDS(0)
>
>
>>Can You help?
>
>>Thank You
>
>>Regards, Mitja
>
>
>>#include "minigui.ch"
>
>>proc main()
>
>>local oServer, oQuery
>
>>oServer:=TMySQLServer():New("localhost", "root", "")
>>if !(oServer==nil)
>
>>  /*
>>     these two commands end with error above:
>
>>       oQuery:=oServer:Query("set names 'cp1250'")
>>       oQuery:=oServer:Query("use test")
>
>>  */
>
>...
>
>
>
>


      
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to