@quba opened this Pull Request on March 27th 2014 Contributor

Fixes error while tracking new visit using mysql 5.6 default config (STRICT_TRANS_TABLES) as it won't cast empty string to 0.

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'config_device_type'

@sgiehl commented on March 27th 2014 Member

Thanks for your PR. Imho it is incorrect to set device type to desktop by default. Unrecognized devices are not always desktop devices. There are a plenty of mobile and other devices that are not detected by now. Piwik should display unrecognized device types as Unknown. If there is an error I guess it occurs where the data is inserted, maybe it needs to be NULL instead of an empty string.

@quba commented on March 27th 2014 Contributor

Yes, you are right (this field allows null) but I didn't want to change anything. Currently piwik is passing empty string to query and mysql (with default config below 5.6) converts it to 0.

@quba commented on March 27th 2014 Contributor

Tests are failing with this change so I'll change it to null and change tests fixtures.

@mattab commented on March 27th 2014 Member

+1 we should fix the actual root cause of the bug and not the data itself, eg. do not insert the values in the visitorArray if they are empty or something. let me know I could take a look... (or create a ticket!)

This Pull Request was closed on March 27th 2014
Powered by GitHub Issue Mirror