~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/lock.cc

  • Committer: Brian Aker
  • Date: 2009-02-22 04:20:22 UTC
  • mfrom: (892.1.9 devel)
  • mto: (896.1.3 fix-osxs)
  • mto: This revision was merged to the branch mainline in revision 898.
  • Revision ID: brian@tangent.org-20090222042022-agjb1l7pczbbcqt5
Merge Monty

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 *session, TableList *table_list)
 
1569
int check_transactional_lock(Session *, TableList *table_list)
1570
1570
{
1571
1571
  TableList    *tlist;
1572
1572
  int           result= 0;
1573
 
  char          warn_buff[DRIZZLE_ERRMSG_SIZE];
1574
1573
 
1575
1574
  for (tlist= table_list; tlist; tlist= tlist->next_global)
1576
1575
  {
1594
1593
      continue;
1595
1594
    }
1596
1595
 
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),
1608
 
             tlist->alias ? tlist->alias : tlist->table_name);
1609
 
    push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1610
 
                 ER_WARN_AUTO_CONVERT_LOCK, warn_buff);
1611
1596
  }
1612
1597
 
1613
1598
  return(result);