Re: [Maria-developers] Rev 4019: MDEV-5505: Assertion `! is_set()' fails on PREPARE SELECT with out of range in GROUP BY

2014-01-26 Thread Sergei Golubchik
Hi, Sanja!

On Jan 23, sa...@askmonty.org wrote:

 === modified file 'sql/sql_select.cc'
 --- a/sql/sql_select.cc   2014-01-21 13:27:36 +
 +++ b/sql/sql_select.cc   2014-01-23 12:50:54 +
 @@ -20463,7 +20463,8 @@ find_order_in_list(THD *thd, Item **ref_
if (!order_item-fixed 
(order_item-fix_fields(thd, order-item) ||
 (order_item= *order-item)-check_cols(1) ||
 -   thd-is_fatal_error))
 +   thd-is_fatal_error ||
 +   thd-is_error()))
  return TRUE; /* Wrong field. */

Why not simply 

 -   thd-is_fatal_error))
 +   thd-is_error()))

can there be a fatal error that is not an error? :)

Regards,
Sergei

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] uint6korr optimization

2014-01-26 Thread Alexey Botchkov

Thanks for the suggestions, Kristian.
I for some reason didn't notice that __builtin_bswap things.

Best regards.
HF


23.01.2014 19:51, Kristian Nielsen wrote:

Kristian Nielsen kniel...@knielsen-hq.org writes:


Do it like this:
static inline ulonglong
mi_uint6korr(const void *p)
{
   uint32 a= *(uint32 *)p;
   uint16 b= *(uint16 *)(4+(char *)p);
   ulonglong v= ((ulonglong)a | ((ulonglong)b  32))  16;
   asm (bswapq %0 : =r (v) : 0 (v));
   return v;
}

Note that GCC also has __builtin_bswap64() (and __builtin_bswap32()). They
also generate bswap instruction, but would also work on other platforms...

  - Kristian.



___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Review request for a fix for MDEV-5506

2014-01-26 Thread Sergei Golubchik
Hi, Alexander!



Few questions, see below.

 === modified file 'mysql-test/t/timezone2.test'
 --- mysql-test/t/timezone2.test   2013-08-08 08:58:28 +
 +++ mysql-test/t/timezone2.test   2014-01-23 10:34:46 +
 @@ -298,5 +298,11 @@ SELECT CONVERT_TZ(TIME('00:00:00'),'+00:
  SELECT CONVERT_TZ(TIME('2010-01-01 00:00:00'),'+00:00','+7:5');
  
  --echo #
 +--echo # MDEV-5506 safe_mutex: Trying to lock unitialized mutex at 
 safemalloc.c on server shutdown after SELECT with CONVERT_TZ
 +--echo #
 +SELECT CONVERT_TZ('2001-10-08 00:00:00', MAKE_SET(0,'+01:00'), '+00:00' ); 

hmm, the bug description was at shutdown. I don't see a shutdown in
your test case. I suppose, you assume that the server will be eventually
shut down and that'll do. But perhaps it needs to be shut down
immediately, and if mtr will do a lot of work in this server the test
case becomes invalid - it won't crash anymore?

 === modified file 'sql/item_strfunc.cc'
 --- sql/item_strfunc.cc   2013-09-25 12:30:13 +
 +++ sql/item_strfunc.cc   2014-01-23 10:17:57 +
 @@ -43,7 +43,7 @@ C_MODE_END
  /**
 @todo Remove this. It is not safe to use a shared String object.
   */

I guess, you've fixed that and can remove the comment.

 -String my_empty_string(,default_charset_info);
 +String_const my_empty_string(, default_charset_info);
  
 === modified file 'sql/sql_string.h'
 --- sql/sql_string.h  2012-11-09 08:11:20 +
 +++ sql/sql_string.h  2014-01-23 10:26:13 +
 @@ -56,25 +56,52 @@ uint convert_to_printable(char *to, size
  
  class String
  {
 +  typedef enum
 +  {
 +STRING_FLAG_NONE= 0,
 +STRING_FLAG_ALLOCED= 1,
 +STRING_FLAG_READ_ONLY= 2,
 +STRING_FLAG_NULL_TERMINATED= 4
 +  } flag_t;
char *Ptr;
uint32 str_length,Alloced_length, extra_alloc;
 -  bool alloced;
 +  flag_t flags;
CHARSET_INFO *str_charset;

Okay, I understand what you did. But I don't understand why.
What was the problem? Why there was a crash?

Regards,
Sergei

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp