microsoft / msphpsql

Microsoft Drivers for PHP for SQL Server
MIT License
1.78k stars 371 forks source link

Add fetch_bignumeric attribute #1500

Open startork opened 5 months ago

startork commented 5 months ago

Related to #1498

Add in optional bignumeric attribute which converts sql bigints to php ints and sql decimal and numeric to php float

Add basic tests for string vs int/float returns

startork commented 5 months ago

Hi @v-makouz Would you be able to give me some advice? I'm unsure whether to a) Treat bigints as integers straight from the start, using c++ long long types or b) to handle similar to datetime, keeping existing code as much as possible and only converting to int when required as a zval.

Thanks, Starsky

v-makouz commented 5 months ago

I think treating it like datetime would be more straightforward. But I see there are still some automated test fails, like the "Numeric value out of range"