diff options
author | unknown <pem@mysql.comhem.se> | 2003-11-21 14:00:40 +0100 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2003-11-21 14:00:40 +0100 |
commit | 394ade63060a4c49e706c9e29c96ac4821d68bb4 (patch) | |
tree | ef97afec1a7efffc84273077eb0fcff88f5ec91a /sql/sp_head.cc | |
parent | 50685be51b54985cccaa299cb6d7a43ff1cbe2a1 (diff) | |
download | mariadb-git-394ade63060a4c49e706c9e29c96ac4821d68bb4.tar.gz |
Made Item_splocal printable.
sql/sp_head.cc:
Fixed bug that showed up when using running with --debug.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 41db1f6dd70..70810265926 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -70,22 +70,32 @@ sp_eval_func_item(THD *thd, Item *it, enum enum_field_types type) { longlong i= it->val_int(); - DBUG_PRINT("info", ("INT_RESULT: %d", i)); if (it->null_value) + { + DBUG_PRINT("info", ("INT_RESULT: null")); it= new Item_null(); + } else + { + DBUG_PRINT("info", ("INT_RESULT: %d", i)); it= new Item_int(it->val_int()); + } break; } case REAL_RESULT: { double d= it->val(); - DBUG_PRINT("info", ("REAL_RESULT: %g", d)); if (it->null_value) + { + DBUG_PRINT("info", ("REAL_RESULT: null")); it= new Item_null(); + } else + { + DBUG_PRINT("info", ("REAL_RESULT: %g", d)); it= new Item_real(it->val()); + } break; } default: @@ -94,12 +104,17 @@ sp_eval_func_item(THD *thd, Item *it, enum enum_field_types type) String tmp(buffer, sizeof(buffer), it->collation.collation); String *s= it->val_str(&tmp); - DBUG_PRINT("info",("default result: %*s",s->length(),s->c_ptr_quick())); if (it->null_value) + { + DBUG_PRINT("info", ("default result: null")); it= new Item_null(); + } else + { + DBUG_PRINT("info",("default result: %*s",s->length(),s->c_ptr_quick())); it= new Item_string(thd->strmake(s->c_ptr_quick(), s->length()), s->length(), it->collation.collation); + } break; } } |