Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No. of attributes is larger than no. of attribute values
Message
From
03/08/2022 04:12:33
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01684739
Message ID:
01684764
Views:
27
Hi Martina,

I changed option=13684 (Treat BIGINT columns as INT columns) to option=536870912 (Bind BIGINT parameters as strings).

select 4000000000 yielded "4000000000 " -> a 20 character string.

So I guess option=536870912 is way better?

Dennis


>Hi Denis,
>
>ODBC driver converts number 4000000000 to -294967296?
>
>Hmm,
>
>
>?CAST(4000000000 as int) && return -294967296
>
>
>IMHO, the ODBC driver got 4000000000 as bigint, but VFP don't know bigint datatype and convert to signed int.
>Question is why ODBC driver ignore NO_BIGINT flag?
>
>
>
>select CAST(4000000000 AS DECIMAL(20))
>-- select CAST(4000000000 AS INTEGER) -- converts to bigint - by documentation
>
>
>MartinaJ
>
>>Hi Martina,
>>
>>I tried the different select's you told me to do:
>>
>>
>>select 1
>>select 10
>>select 10000
>>select 4000000000
>>
>>
>>The first 3 yielded the same numbers, except for 4000000000, which yielded -294967296 !!!
>>
>>Why is this so? Pardon my ignorance.
>>
>>Regards
>>Dennis
>>
>>
>>
>>>Really? I don't know.
>>>But if somebody has same problem in c# too, then bug cannot be in VFP only.
>>>
>>>MartinaJ
>>>
>>>>Hi
>>>>
>>>>So you mean this issue is not on the VFP side?
>>>>
>>>>>Hi Dennis,
>>>>>
>>>>> Try it.
>>>>>
>>>>>Also, you can test another simply select:
>>>>>
>>>>>select 1
>>>>>select 10
>>>>>select 10000
>>>>>select 4000000000
>>>>>
>>>>>
>>>>>PS: you are not first:
>>>>>https://stackoverflow.com/questions/72920836/an-out-of-date-binding-error-between-mysql-db-visual-studio-20192022
>>>>>
>>>>> MartinaJ
>>>>>
>>>>>>Hi Martina,
>>>>>>
>>>>>>Yes, I use OPTION=16384 (NO_BIGINT) in my connection string.
>>>>>>Should I also add COLUMN_SIZE_S32?
>>>>>>
>>>>>>Another observation is, if I use that SELECT statement on its own, it works. But if done with a group of SELECT statements, it goes berserk.
>>>>>>
>>>>>>Also, right after getting this particular error, the MySQL connection is immediately cut off.
>>>>>>
>>>>>>Thanks
>>>>>>
>>>>>>>Hi,
>>>>>>>
>>>>>>>Did you set OPTION flag (FLAG_COLUMN_SIZE_S32 or FLAG_NO_BIGINT) in connect string?
>>>>>>>
>>>>>>>MartinaJ
>>>>>>>
>>>>>>>>Hi All,
>>>>>>>>
>>>>>>>>For the longest time, I have been using SELECT COUNT(*) to get the total number of rows for any SELECT statement.
>>>>>>>>
>>>>>>>>But this one is weird:
>>>>>>>>
>>>>>>>>select count(*) as totrecs from pihdr a left join supplier b on a.supplierid=b.id left join ewtax c on a.ewtaxid=c.id left join jthdr d on a.jthdrid=d.id
>>>>>>>>
>>>>>>>>
>>>>>>>>In my ODBC trace log, this is what I found:
>>>>>>>>
>>>>>>>>DIAG [01000] [MySQL][ODBC 8.0(w)Driver][mysqld-8.0.30]The number of attributes is larger than the number of attribute values provided (500)
>>>>>>>>
>>>>>>>>The offending statement does not even show in the ODBC Trace log.
>>>>>>>>
>>>>>>>>That is why I tried substituting it with (which is already deprecated):
>>>>>>>>
>>>>>>>>
>>>>>>>>select SQL_CALC_FOUND_ROWS * from pihdr a left join supplier b on
>>>>>>>>a.supplierid=b.id left join ewtax c on a.ewtaxid=c.id left join jthdr d
>>>>>>>>on a.jthdrid=d.id
>>>>>>>>
>>>>>>>>select FOUND_ROWS() as totrecs 
>>>>>>>>
>>>>>>>>
>>>>>>>>Still yields same error.
>>>>>>>>
>>>>>>>>My code works with MySQL ODBC 8.0.30 and MySQL Server 5.7.37 perfectly... when I run it with MySQL ODBC 8.0.30 and MySQL Server 8.0.30.. that is where the error appear...
>>>>>>>>
>>>>>>>>I was going to move up to MySQL 8.0.x. So I guess I have to wait for some resolution to this.
>>>>>>>>
>>>>>>>>I have also filed it in the MySQL bugs database.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform