~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/last_insert.cc

  • Committer: Stewart Smith
  • Author(s): Marko Mäkelä
  • Date: 2010-12-20 03:21:44 UTC
  • mto: (2021.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2022.
  • Revision ID: stewart@flamingspork.com-20101220032144-7aqh2z403u7d7bdp
Merge Revision revid:marko.makela@oracle.com-20101104131215-pfxnpidlrzd4krg0 from MySQL InnoDB

Original revid:marko.makela@oracle.com-20101104131215-pfxnpidlrzd4krg0

Original Authors: Marko Mäkelä <marko.makela@oracle.com>
Original commit message:
row_ins_index_entry(): Note that only CREATE INDEX sets foreign=FALSE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <drizzled/server_includes.h>
21
 
#include CSTDINT_H
22
 
#include <drizzled/functions/last_insert.h>
 
20
#include "config.h"
 
21
 
 
22
#include <drizzled/function/last_insert.h>
23
23
#include <drizzled/session.h>
24
24
 
 
25
namespace drizzled
 
26
{
 
27
 
25
28
int64_t Item_func_last_insert_id::val_int()
26
29
{
27
 
  Session *session= current_session;
28
30
  assert(fixed == 1);
29
31
  if (arg_count)
30
32
  {
37
39
      LAST_INSERT_ID(X) take precedence over an generated auto_increment
38
40
      value for this row.
39
41
    */
40
 
    session->arg_of_last_insert_id_function= true;
41
 
    session->first_successful_insert_id_in_prev_stmt= value;
 
42
    getSession().arg_of_last_insert_id_function= true;
 
43
    getSession().first_successful_insert_id_in_prev_stmt= value;
 
44
 
42
45
    return value;
43
46
  }
44
 
  return session->read_first_successful_insert_id_in_prev_stmt();
 
47
  return getSession().read_first_successful_insert_id_in_prev_stmt();
45
48
}
46
49
 
47
50
 
50
53
  return Item_int_func::fix_fields(session, ref);
51
54
}
52
55
 
 
56
} /* namespace drizzled */