~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 05:57:49 UTC
  • Revision ID: brian@tangent.org-20081006055749-svg700gciuqi0zu1
Remove all of uchar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
405
405
  if (packet_length == 0)                       /* safety */
406
406
  {
407
407
    /* Initialize with COM_SLEEP packet */
408
 
    packet[0]= (uchar) COM_SLEEP;
 
408
    packet[0]= (unsigned char) COM_SLEEP;
409
409
    packet_length= 1;
410
410
  }
411
411
  /* Do not rely on my_net_read, extra safety against programming errors. */
412
412
  packet[packet_length]= '\0';                  /* safety */
413
413
 
414
 
  command= (enum enum_server_command) (uchar) packet[0];
 
414
  command= (enum enum_server_command) (unsigned char) packet[0];
415
415
 
416
416
  if (command >= COM_END)
417
417
    command= COM_END;                           // Wrong command
557
557
  }
558
558
  case COM_REGISTER_SLAVE:
559
559
  {
560
 
    if (!register_slave(thd, (uchar*)packet, packet_length))
 
560
    if (!register_slave(thd, (unsigned char*)packet, packet_length))
561
561
      my_ok(thd);
562
562
    break;
563
563
  }
592
592
      break;
593
593
    }
594
594
    uint32_t passwd_len= (thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
595
 
                      (uchar)(*passwd++) : strlen(passwd));
 
595
                      (unsigned char)(*passwd++) : strlen(passwd));
596
596
    uint32_t dummy_errors, save_db_length, db_length;
597
597
    int res;
598
598
    Security_context save_security_ctx= *thd->security_ctx;
759
759
    mysql_reset_thd_for_next_command(thd);
760
760
 
761
761
    thd->lex->
762
 
      select_lex.table_list.link_in_list((uchar*) &table_list,
763
 
                                         (uchar**) &table_list.next_local);
 
762
      select_lex.table_list.link_in_list((unsigned char*) &table_list,
 
763
                                         (unsigned char**) &table_list.next_local);
764
764
    thd->lex->add_to_query_tables(&table_list);
765
765
 
766
766
    /* switch on VIEW optimisation: do not fill temporary tables */
1036
1036
  }
1037
1037
  /* We must allocate some extra memory for query cache */
1038
1038
  thd->query_length= 0;                        // Extra safety: Avoid races
1039
 
  if (!(thd->query= (char*) thd->memdup_w_gap((uchar*) (packet),
 
1039
  if (!(thd->query= (char*) thd->memdup_w_gap((unsigned char*) (packet),
1040
1040
                                              packet_length,
1041
1041
                                              thd->db_length+ 1)))
1042
1042
    return true;
1678
1678
      Presumably, REPAIR and binlog writing doesn't require synchronization
1679
1679
    */
1680
1680
    write_bin_log(thd, true, thd->query, thd->query_length);
1681
 
    select_lex->table_list.first= (uchar*) first_table;
 
1681
    select_lex->table_list.first= (unsigned char*) first_table;
1682
1682
    lex->query_tables=all_tables;
1683
1683
    break;
1684
1684
  }
1687
1687
    assert(first_table == all_tables && first_table != 0);
1688
1688
    thd->enable_slow_log= opt_log_slow_admin_statements;
1689
1689
    res = mysql_check_table(thd, first_table, &lex->check_opt);
1690
 
    select_lex->table_list.first= (uchar*) first_table;
 
1690
    select_lex->table_list.first= (unsigned char*) first_table;
1691
1691
    lex->query_tables=all_tables;
1692
1692
    break;
1693
1693
  }
1698
1698
    res= mysql_analyze_table(thd, first_table, &lex->check_opt);
1699
1699
    /* ! we write after unlocking the table */
1700
1700
    write_bin_log(thd, true, thd->query, thd->query_length);
1701
 
    select_lex->table_list.first= (uchar*) first_table;
 
1701
    select_lex->table_list.first= (unsigned char*) first_table;
1702
1702
    lex->query_tables=all_tables;
1703
1703
    break;
1704
1704
  }
1710
1710
    res= mysql_optimize_table(thd, first_table, &lex->check_opt);
1711
1711
    /* ! we write after unlocking the table */
1712
1712
    write_bin_log(thd, true, thd->query, thd->query_length);
1713
 
    select_lex->table_list.first= (uchar*) first_table;
 
1713
    select_lex->table_list.first= (unsigned char*) first_table;
1714
1714
    lex->query_tables=all_tables;
1715
1715
    break;
1716
1716
  }
1831
1831
    {
1832
1832
      /* Skip first table, which is the table we are inserting in */
1833
1833
      TableList *second_table= first_table->next_local;
1834
 
      select_lex->table_list.first= (uchar*) second_table;
 
1834
      select_lex->table_list.first= (unsigned char*) second_table;
1835
1835
      select_lex->context.table_list= 
1836
1836
        select_lex->context.first_name_resolution_table= second_table;
1837
1837
      res= mysql_insert_select_prepare(thd);
1861
1861
        delete sel_result;
1862
1862
      }
1863
1863
      /* revert changes for SP */
1864
 
      select_lex->table_list.first= (uchar*) first_table;
 
1864
      select_lex->table_list.first= (unsigned char*) first_table;
1865
1865
    }
1866
1866
 
1867
1867
    break;
2333
2333
    for (sv=thd->transaction.savepoints; sv; sv=sv->prev)
2334
2334
    {
2335
2335
      if (my_strnncoll(system_charset_info,
2336
 
                       (uchar *)lex->ident.str, lex->ident.length,
2337
 
                       (uchar *)sv->name, sv->length) == 0)
 
2336
                       (unsigned char *)lex->ident.str, lex->ident.length,
 
2337
                       (unsigned char *)sv->name, sv->length) == 0)
2338
2338
        break;
2339
2339
    }
2340
2340
    if (sv)
2355
2355
    for (sv=thd->transaction.savepoints; sv; sv=sv->prev)
2356
2356
    {
2357
2357
      if (my_strnncoll(system_charset_info,
2358
 
                       (uchar *)lex->ident.str, lex->ident.length,
2359
 
                       (uchar *)sv->name, sv->length) == 0)
 
2358
                       (unsigned char *)lex->ident.str, lex->ident.length,
 
2359
                       (unsigned char *)sv->name, sv->length) == 0)
2360
2360
        break;
2361
2361
    }
2362
2362
    if (sv)
2389
2389
      for (sv=&thd->transaction.savepoints; *sv; sv=&(*sv)->prev)
2390
2390
      {
2391
2391
        if (my_strnncoll(system_charset_info,
2392
 
                         (uchar *)lex->ident.str, lex->ident.length,
2393
 
                         (uchar *)(*sv)->name, (*sv)->length) == 0)
 
2392
                         (unsigned char *)lex->ident.str, lex->ident.length,
 
2393
                         (unsigned char *)(*sv)->name, (*sv)->length) == 0)
2394
2394
          break;
2395
2395
      }
2396
2396
      if (*sv) /* old savepoint of the same name exists */
2545
2545
  - Passing to check_stack_overrun() prevents the compiler from removing it.
2546
2546
*/
2547
2547
bool check_stack_overrun(THD *thd, long margin,
2548
 
                         uchar *buf __attribute__((unused)))
 
2548
                         unsigned char *buf __attribute__((unused)))
2549
2549
{
2550
2550
  long stack_used;
2551
2551
  assert(thd == current_thd);
2572
2572
  if (!lex->yacc_yyvs)
2573
2573
    old_info= *yystacksize;
2574
2574
  *yystacksize= set_zone((*yystacksize)*2,MY_YACC_INIT,MY_YACC_MAX);
2575
 
  if (!(lex->yacc_yyvs= (uchar*)
 
2575
  if (!(lex->yacc_yyvs= (unsigned char*)
2576
2576
        my_realloc(lex->yacc_yyvs,
2577
2577
                   *yystacksize*sizeof(**yyvs),
2578
2578
                   MYF(MY_ALLOW_ZERO_PTR | MY_FREE_ON_ERROR))) ||
2579
 
      !(lex->yacc_yyss= (uchar*)
 
2579
      !(lex->yacc_yyss= (unsigned char*)
2580
2580
        my_realloc(lex->yacc_yyss,
2581
2581
                   *yystacksize*sizeof(**yyss),
2582
2582
                   MYF(MY_ALLOW_ZERO_PTR | MY_FREE_ON_ERROR))))
3015
3015
  *item_ptr= item;
3016
3016
  order->item=item_ptr;
3017
3017
  order->free_me=0;
3018
 
  thd->lex->proc_list.link_in_list((uchar*) order,(uchar**) &order->next);
 
3018
  thd->lex->proc_list.link_in_list((unsigned char*) order,(unsigned char**) &order->next);
3019
3019
  return 0;
3020
3020
}
3021
3021
 
3035
3035
  order->free_me=0;
3036
3036
  order->used=0;
3037
3037
  order->counter_used= 0;
3038
 
  list.link_in_list((uchar*) order,(uchar**) &order->next);
 
3038
  list.link_in_list((unsigned char*) order,(unsigned char**) &order->next);
3039
3039
  return(0);
3040
3040
}
3041
3041
 
3193
3193
    previous table reference to 'ptr'. Here we also add one element to the
3194
3194
    list 'table_list'.
3195
3195
  */
3196
 
  table_list.link_in_list((uchar*) ptr, (uchar**) &ptr->next_local);
 
3196
  table_list.link_in_list((unsigned char*) ptr, (unsigned char**) &ptr->next_local);
3197
3197
  ptr->next_name_resolution_table= NULL;
3198
3198
  /* Link table in global list (all used tables) */
3199
3199
  lex->add_to_query_tables(ptr);
3229
3229
                                       sizeof(nested_join_st))))
3230
3230
    return(1);
3231
3231
  nested_join= ptr->nested_join=
3232
 
    ((nested_join_st*) ((uchar*) ptr + ALIGN_SIZE(sizeof(TableList))));
 
3232
    ((nested_join_st*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList))));
3233
3233
 
3234
3234
  join_list->push_front(ptr);
3235
3235
  ptr->embedding= embedding;
3307
3307
                                       sizeof(nested_join_st))))
3308
3308
    return(0);
3309
3309
  nested_join= ptr->nested_join=
3310
 
    ((nested_join_st*) ((uchar*) ptr + ALIGN_SIZE(sizeof(TableList))));
 
3310
    ((nested_join_st*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList))));
3311
3311
 
3312
3312
  ptr->embedding= embedding;
3313
3313
  ptr->join_list= join_list;
4331
4331
  if (home_dir_len < dir_len)
4332
4332
  {
4333
4333
    if (!my_strnncoll(character_set_filesystem,
4334
 
                      (const uchar*) conv_path, home_dir_len,
4335
 
                      (const uchar*) mysql_unpacked_real_data_home,
 
4334
                      (const unsigned char*) conv_path, home_dir_len,
 
4335
                      (const unsigned char*) mysql_unpacked_real_data_home,
4336
4336
                      home_dir_len))
4337
4337
      return(1);
4338
4338
  }