mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
ORDER BY optimization
Fixed new bug when reading field types client/mysql.cc: Fixed output for -T libmysql/libmysql.c: Filled missing fields in new MYSQL_FIELD structure Fixed new bug when reading field types mysql-test/r/order_by.result: Result after new order by optimization sql/opt_range.cc: New ORDER BY optimization sql/opt_range.h: New ORDER BY optimization sql/set_var.cc: Speed optimization sql/sql_select.cc: New ORDER BY optimization This alllows MySQL to change a ref/range index from (a,b) to (a,c) when 'b' was not used to find rows and one did ORDER BY a,c or ORDER BY c
This commit is contained in:
@ -1207,6 +1207,10 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
|
||||
field->length= (uint) uint3korr(row->data[2]);
|
||||
field->type= (enum enum_field_types) (uchar) row->data[3][0];
|
||||
|
||||
field->catalog=(char*) "";
|
||||
field->db= (char*) "";
|
||||
field->catalog_length= 0;
|
||||
field->db_length= 0;
|
||||
field->org_table_length= field->table_length= lengths[0];
|
||||
field->name_length= lengths[1];
|
||||
|
||||
@ -2883,7 +2887,7 @@ get_info:
|
||||
|
||||
mysql->extra_info= net_field_length_ll(&pos); /* Maybe number of rec */
|
||||
|
||||
if (!(fields=read_rows(mysql,(MYSQL_FIELD*)0, protocol_41(mysql) ? 6 : 5)))
|
||||
if (!(fields=read_rows(mysql,(MYSQL_FIELD*)0, protocol_41(mysql) ? 7 : 5)))
|
||||
DBUG_RETURN(1);
|
||||
if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,
|
||||
(uint) field_count,0,
|
||||
|
Reference in New Issue
Block a user