old mysql doesn't support 'cast(1 as integer)', but new/mariadb does postgres doesn't support 'cast(1 as signed)' should fix #145