diff options
author | unknown <monty@mysql.com> | 2005-02-15 16:45:00 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-02-15 16:45:00 +0200 |
commit | 67b16d202b6e6912d6018685a0f7b0bb55cfbbad (patch) | |
tree | 16b9cc851452c212c3d986a1f88c4ae9a2f5d862 /sql/filesort.cc | |
parent | 40ffce74eb09dc1fd59d9d67fd44688be7f92fca (diff) | |
download | mariadb-git-67b16d202b6e6912d6018685a0f7b0bb55cfbbad.tar.gz |
Fixed failing test cases 'row.test' when running with --ps-protocol
Simple optimzations done while reviewing code
client/mysqltest.c:
Added options --enable-ps-warnings and --disable-ps-warnings
(to fix failing test case)
mysql-test/t/row.test:
Disable warnings that comes from 'parse' parth
sql/field.cc:
Removed calls to is_null() in field functions.
(Not needed as NULL handling is done on the level above fields)
Indentation fixes
Removed calls to alloca() as buffer needed was quite small.
sql/field.h:
Indentation changes and comment fixes
sql/filesort.cc:
Simple optimization during code review
sql/item.cc:
Indentation fixes
Removed some unnecessary tests (added DBUG_ASSERTS() instead)
sql/item_buff.cc:
Indentation fixes
sql/my_decimal.cc:
Indentation fixes
Simple optimization
Fixed compiler warning
sql/sql_update.cc:
Removed unnessessary assignment
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r-- | sql/filesort.cc | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index 956ac2ef61b..c05baa7cc04 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -619,20 +619,21 @@ static void make_sortkey(register SORTPARAM *param, else { // Item Item *item=sort_field->item; + maybe_null= item->maybe_null; switch (sort_field->result_type) { case STRING_RESULT: { CHARSET_INFO *cs=item->collation.collation; char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' '); - if ((maybe_null=item->maybe_null)) + if (maybe_null) *to++=1; /* All item->str() to use some extra byte for end null.. */ String tmp((char*) to,sort_field->length+4,cs); String *res=item->val_str(&tmp); if (!res) { - if (item->maybe_null) + if (maybe_null) bzero((char*) to-1,sort_field->length+1); else { @@ -672,20 +673,22 @@ static void make_sortkey(register SORTPARAM *param, case INT_RESULT: { longlong value=item->val_int(); - if ((maybe_null=item->maybe_null)) + if (maybe_null) + { *to++=1; /* purecov: inspected */ - if (item->null_value) - { - if (item->maybe_null) - bzero((char*) to-1,sort_field->length+1); - else - { - DBUG_PRINT("warning", - ("Got null on something that shouldn't be null")); - bzero((char*) to,sort_field->length); - } - break; - } + if (item->null_value) + { + if (maybe_null) + bzero((char*) to-1,sort_field->length+1); + else + { + DBUG_PRINT("warning", + ("Got null on something that shouldn't be null")); + bzero((char*) to,sort_field->length); + } + break; + } + } #if SIZEOF_LONG_LONG > 4 to[7]= (uchar) value; to[6]= (uchar) (value >> 8); @@ -706,14 +709,16 @@ static void make_sortkey(register SORTPARAM *param, case DECIMAL_RESULT: { my_decimal dec_buf, *dec_val= item->val_decimal(&dec_buf); - if ((maybe_null=item->null_value)) - { - bzero((char*)to, sort_field->length+1); - to++; - break; - } - if ((maybe_null=item->maybe_null)) + if (maybe_null) + { + if (item->null_value) + { + bzero((char*)to, sort_field->length+1); + to++; + break; + } *to++=1; + } my_decimal2binary(E_DEC_FATAL_ERROR, dec_val, (byte*)to, item->max_length - (item->decimals ? 1:0), item->decimals); @@ -722,14 +727,16 @@ static void make_sortkey(register SORTPARAM *param, case REAL_RESULT: { double value= item->val_real(); - if ((maybe_null=item->null_value)) - { - bzero((char*) to,sort_field->length+1); - to++; - break; - } - if ((maybe_null=item->maybe_null)) + if (maybe_null) + { + if (item->null_value) + { + bzero((char*) to,sort_field->length+1); + to++; + break; + } *to++=1; + } change_double_for_sort(value,(byte*) to); break; } |