~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/lock.cc

  • Committer: Monty Taylor
  • Date: 2009-02-05 18:47:43 UTC
  • mfrom: (779.8.3 devel)
  • mto: This revision was merged to the branch mainline in revision 840.
  • Revision ID: mordred@inaugust.com-20090205184743-sn55g5b30qvdcy4h
Merged from me again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1566
1566
    -1                  Error: Lock conversion is prohibited.
1567
1567
*/
1568
1568
 
1569
 
int check_transactional_lock(Session *, TableList *table_list)
 
1569
int check_transactional_lock(Session *session, TableList *table_list)
1570
1570
{
1571
1571
  TableList    *tlist;
1572
1572
  int           result= 0;
 
1573
  char          warn_buff[DRIZZLE_ERRMSG_SIZE];
1573
1574
 
1574
1575
  for (tlist= table_list; tlist; tlist= tlist->next_global)
1575
1576
  {
1586
1587
    }
1587
1588
 
1588
1589
    /* We must not convert the lock method in strict mode. */
1589
 
    my_error(ER_NO_AUTO_CONVERT_LOCK_STRICT, MYF(0),
 
1590
    {
 
1591
      my_error(ER_NO_AUTO_CONVERT_LOCK_STRICT, MYF(0),
 
1592
               tlist->alias ? tlist->alias : tlist->table_name);
 
1593
      result= -1;
 
1594
      continue;
 
1595
    }
 
1596
 
 
1597
    /* We must not convert the lock method within an active transaction. */
 
1598
    if (session->active_transaction())
 
1599
    {
 
1600
      my_error(ER_NO_AUTO_CONVERT_LOCK_TRANSACTION, MYF(0),
 
1601
               tlist->alias ? tlist->alias : tlist->table_name);
 
1602
      result= -1;
 
1603
      continue;
 
1604
    }
 
1605
 
 
1606
    /* Warn about the conversion. */
 
1607
    snprintf(warn_buff, sizeof(warn_buff), ER(ER_WARN_AUTO_CONVERT_LOCK),
1590
1608
             tlist->alias ? tlist->alias : tlist->table_name);
1591
 
    result= -1;
1592
 
    continue;
1593
 
 
 
1609
    push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
1610
                 ER_WARN_AUTO_CONVERT_LOCK, warn_buff);
1594
1611
  }
1595
1612
 
1596
1613
  return(result);