Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: vbgamer45 on February 03, 2017, 12:02:40 AM

Title: [2.0.13] smf_db_create_table no $column_info
Post by: vbgamer45 on February 03, 2017, 12:02:40 AM
function smf_db_create_table($table_name, $columns, $indexes = array(), $parameters = array(), $if_exists = 'ignore', $error = 'fatal')

This line changed to
Code: [Select]
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column['unsigned']) ? 'unsigned ' : '';
To
Code: [Select]
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint', 'float')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';
Issue there is no $column_info

It was done in some other spots but it makes sense in those spots
Title: Re: [2.0.13] smf_db_create_table no $column_info
Post by: live627 on February 03, 2017, 06:50:42 PM
Can you check if this issue is also in 2.1? I'm not in a coding mood right now... (burnout yet again)
Title: Re: [2.0.13] smf_db_create_table no $column_info
Post by: vbgamer45 on February 03, 2017, 06:56:17 PM
Does not affect 2.1
Title: Re: [2.0.13] smf_db_create_table no $column_info
Post by: albertlast on February 04, 2017, 04:02:28 AM
I would like to comment this part in general:

In my eyes you should forget that unsigned exists,
from sql standard pov is garbage.

And i know "mysql can it" and "smf use it" but both is wrong.

the api of smf is designed to work with all supported databases.
In smf 2.1 is it mysql and pg,
and you run in trouble when the min and max value in both database is different.