~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/lock.cc

  • Committer: Monty Taylor
  • Date: 2008-08-02 01:03:15 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080802010315-65h5938pymg9d99z
Moved m4 macros to top-level m4 dir, per GNU standards (and where gettext wanted it :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
  Change to use my_malloc() ONLY when using LOCK TABLES command or when
73
73
  we are forced to use mysql_lock_merge.
74
74
*/
75
 
#include <drizzled/server_includes.h>
 
75
 
 
76
#include "mysql_priv.h"
 
77
#include <mysys/hash.h>
 
78
#include <assert.h>
76
79
#include <drizzled/drizzled_error_messages.h>
77
80
 
78
81
/**
512
515
        removed_locks= table->lock_count;
513
516
 
514
517
        /* Move down all table pointers above 'i'. */
515
 
        memcpy((locked->table+i), (locked->table+i+1),
 
518
        memcpy((char*) (locked->table+i),
 
519
               (char*) (locked->table+i+1),
516
520
               (old_tables - i) * sizeof(TABLE*));
517
521
 
518
522
        lock_data_end= table->lock_data_start + table->lock_count;
519
523
        /* Move down all lock data pointers above 'table->lock_data_end-1' */
520
 
        memcpy((locked->locks + table->lock_data_start),
521
 
               (locked->locks + lock_data_end),
 
524
        memcpy((char*) (locked->locks + table->lock_data_start),
 
525
               (char*) (locked->locks + lock_data_end),
522
526
               (locked->lock_count - lock_data_end) *
523
527
               sizeof(THR_LOCK_DATA*));
524
528
 
633
637
         b->lock_count*sizeof(*b->locks));
634
638
  memcpy(sql_lock->table,a->table,a->table_count*sizeof(*a->table));
635
639
  memcpy(sql_lock->table+a->table_count,b->table,
636
 
         b->table_count*sizeof(*b->table));
 
640
         b->table_count*sizeof(*b->table));
637
641
 
638
642
  /*
639
643
    Now adjust lock_position and lock_data_start for all objects that was
1631
1635
{
1632
1636
  TABLE_LIST    *tlist;
1633
1637
  int           result= 0;
1634
 
  char          warn_buff[DRIZZLE_ERRMSG_SIZE];
 
1638
  char          warn_buff[MYSQL_ERRMSG_SIZE];
1635
1639
 
1636
1640
  for (tlist= table_list; tlist; tlist= tlist->next_global)
1637
1641
  {
1667
1671
    /* Warn about the conversion. */
1668
1672
    snprintf(warn_buff, sizeof(warn_buff), ER(ER_WARN_AUTO_CONVERT_LOCK),
1669
1673
             tlist->alias ? tlist->alias : tlist->table_name);
1670
 
    push_warning(thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
1674
    push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
1671
1675
                 ER_WARN_AUTO_CONVERT_LOCK, warn_buff);
1672
1676
  }
1673
1677