~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_strfunc.cc

MergedĀ fromĀ Felipe

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
      if (res->length()+res2->length() >
132
132
          current_thd->variables.max_allowed_packet)
133
133
      {
134
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
134
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
135
135
                            ER_WARN_ALLOWED_PACKET_OVERFLOWED,
136
136
                            ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
137
137
                            current_thd->variables.max_allowed_packet);
292
292
    if (res->length() + sep_str->length() + res2->length() >
293
293
        current_thd->variables.max_allowed_packet)
294
294
    {
295
 
      push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
295
      push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
296
296
                          ER_WARN_ALLOWED_PACKET_OVERFLOWED,
297
297
                          ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
298
298
                          current_thd->variables.max_allowed_packet);
549
549
          if (res->length()-from_length + to_length >
550
550
              current_thd->variables.max_allowed_packet)
551
551
          {
552
 
            push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
552
            push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
553
553
                                ER_WARN_ALLOWED_PACKET_OVERFLOWED,
554
554
                                ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
555
555
                                func_name(),
578
578
      if (res->length()-from_length + to_length >
579
579
          current_thd->variables.max_allowed_packet)
580
580
      {
581
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
581
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
582
582
                            ER_WARN_ALLOWED_PACKET_OVERFLOWED,
583
583
                            ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
584
584
                            current_thd->variables.max_allowed_packet);
656
656
  if ((uint64_t) (res->length() - length + res2->length()) >
657
657
      (uint64_t) current_thd->variables.max_allowed_packet)
658
658
  {
659
 
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
659
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
660
660
                        ER_WARN_ALLOWED_PACKET_OVERFLOWED,
661
661
                        ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
662
662
                        func_name(), current_thd->variables.max_allowed_packet);
1735
1735
  // Safe length check
1736
1736
  if (length > current_thd->variables.max_allowed_packet / (uint) count)
1737
1737
  {
1738
 
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
1738
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1739
1739
                        ER_WARN_ALLOWED_PACKET_OVERFLOWED,
1740
1740
                        ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
1741
1741
                        func_name(), current_thd->variables.max_allowed_packet);
1825
1825
  byte_count= count * collation.collation->mbmaxlen;
1826
1826
  if ((uint64_t) byte_count > current_thd->variables.max_allowed_packet)
1827
1827
  {
1828
 
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
1828
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1829
1829
                        ER_WARN_ALLOWED_PACKET_OVERFLOWED,
1830
1830
                        ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
1831
1831
                        func_name(), current_thd->variables.max_allowed_packet);
1930
1930
  
1931
1931
  if ((uint64_t) byte_count > current_thd->variables.max_allowed_packet)
1932
1932
  {
1933
 
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
1933
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1934
1934
                        ER_WARN_ALLOWED_PACKET_OVERFLOWED,
1935
1935
                        ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
1936
1936
                        func_name(), current_thd->variables.max_allowed_packet);
2292
2292
  }
2293
2293
  if (stat_info.st_size > (long) current_thd->variables.max_allowed_packet)
2294
2294
  {
2295
 
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2295
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2296
2296
                        ER_WARN_ALLOWED_PACKET_OVERFLOWED,
2297
2297
                        ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
2298
2298
                        func_name(), current_thd->variables.max_allowed_packet);
2564
2564
                     (const Bytef*)res->ptr(), res->length())) != Z_OK)
2565
2565
  {
2566
2566
    code= err==Z_MEM_ERROR ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_BUF_ERROR;
2567
 
    push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
 
2567
    push_warning(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR, code, ER(code));
2568
2568
    null_value= 1;
2569
2569
    return 0;
2570
2570
  }
2602
2602
  /* If length is less than 4 bytes, data is corrupt */
2603
2603
  if (res->length() <= 4)
2604
2604
  {
2605
 
    push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
 
2605
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
2606
2606
                        ER_ZLIB_Z_DATA_ERROR,
2607
2607
                        ER(ER_ZLIB_Z_DATA_ERROR));
2608
2608
    goto err;
2612
2612
  new_size= uint4korr(res->ptr()) & 0x3FFFFFFF;
2613
2613
  if (new_size > current_thd->variables.max_allowed_packet)
2614
2614
  {
2615
 
    push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
 
2615
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
2616
2616
                        ER_TOO_BIG_FOR_UNCOMPRESS,
2617
2617
                        ER(ER_TOO_BIG_FOR_UNCOMPRESS),
2618
2618
                        current_thd->variables.max_allowed_packet);
2630
2630
 
2631
2631
  code= ((err == Z_BUF_ERROR) ? ER_ZLIB_Z_BUF_ERROR :
2632
2632
         ((err == Z_MEM_ERROR) ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_DATA_ERROR));
2633
 
  push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
 
2633
  push_warning(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR, code, ER(code));
2634
2634
 
2635
2635
err:
2636
2636
  null_value= 1;