Skip to content

Commit

Permalink
Remove data_type argument from MySQL backend describe_column() too
Browse files Browse the repository at this point in the history
This should have been part of fdfcc12 (Remove data_type argument from
describe_column() backend function, 2024-01-03) but was forgotten there.
  • Loading branch information
vadz committed Jan 2, 2024
1 parent 07cb45e commit d8e5472
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/backends/mysql/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,45 +402,38 @@ int mysql_statement_backend::prepare_for_describe()
}

void mysql_statement_backend::describe_column(int colNum,
data_type & type, db_type & dbtype, std::string & columnName)
db_type & dbtype, std::string & columnName)
{
int pos = colNum - 1;
MYSQL_FIELD *field = mysql_fetch_field_direct(result_, pos);
switch (field->type)
{
case FIELD_TYPE_CHAR: //MYSQL_TYPE_TINY:
type = dt_integer;
dbtype = field->flags & UNSIGNED_FLAG ? db_uint8 : db_int8;
break;
case FIELD_TYPE_SHORT: //MYSQL_TYPE_SHORT:
type = dt_integer;
dbtype = field->flags & UNSIGNED_FLAG ? db_uint16 : db_int16;
break;
case FIELD_TYPE_INT24: //MYSQL_TYPE_INT24:
type = dt_integer;
dbtype = field->flags & UNSIGNED_FLAG ? db_uint32 : db_int32;
break;
case FIELD_TYPE_LONG: //MYSQL_TYPE_LONG:
if (field->flags & UNSIGNED_FLAG)
{
type = dt_long_long;
dbtype = db_uint32;
}
else
{
type = dt_integer;
dbtype = db_int32;
}
break;
case FIELD_TYPE_LONGLONG: //MYSQL_TYPE_LONGLONG:
if (field->flags & UNSIGNED_FLAG)
{
type = dt_unsigned_long_long;
dbtype = db_uint64;
}
else
{
type = dt_long_long;
dbtype = db_int64;
}
break;
Expand All @@ -452,7 +445,6 @@ void mysql_statement_backend::describe_column(int colNum,
// sends field type number 246, no matter which version of libraries
// the client is using.
case 246: //MYSQL_TYPE_NEWDECIMAL:
type = dt_double;
dbtype = db_double;
break;
case FIELD_TYPE_TIMESTAMP: //MYSQL_TYPE_TIMESTAMP:
Expand All @@ -461,7 +453,6 @@ void mysql_statement_backend::describe_column(int colNum,
case FIELD_TYPE_DATETIME: //MYSQL_TYPE_DATETIME:
case FIELD_TYPE_YEAR: //MYSQL_TYPE_YEAR:
case FIELD_TYPE_NEWDATE: //MYSQL_TYPE_NEWDATE:
type = dt_date;
dbtype = db_date;
break;
// case MYSQL_TYPE_VARCHAR:
Expand All @@ -472,7 +463,6 @@ void mysql_statement_backend::describe_column(int colNum,
case FIELD_TYPE_TINY_BLOB:
case FIELD_TYPE_MEDIUM_BLOB:
case FIELD_TYPE_LONG_BLOB:
type = dt_string;
dbtype = db_string;
break;
default:
Expand Down

0 comments on commit d8e5472

Please sign in to comment.