Replace custom casting code by proper sql_cast_char2int() core function. MDL-12893 ; merged from 19_STABLE

This commit is contained in:
stronk7
2008-04-21 18:10:09 +00:00
parent 3239b0104e
commit ce7373f85c
+2 -12
View File
@@ -113,18 +113,8 @@ class data_field_date extends data_field_base {
}
function get_sort_sql($fieldname) {
global $CFG;
switch ($CFG->dbfamily) {
case 'postgres':
case 'mssql':
return 'CAST('.$fieldname.' AS bigint)';
case 'oracle':
return 'TO_NUMBER('.$fieldname.')';
case 'mysql':
default:
return 'CAST('.$fieldname.' AS signed)';
}
return sql_cast_char2int($fieldname, true);
}