service_thd_autoinc.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef MYSQL_SERVICE_THD_AUTOINC_INCLUDED
  2. /* Copyright (C) 2013 MariaDB Foundation.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; version 2 of the License.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  13. /**
  14. @file
  15. This service provides access to the auto_increment related system variables:
  16. @@auto_increment_offset
  17. @@auto_increment_increment
  18. */
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. extern struct thd_autoinc_service_st {
  23. void (*thd_get_autoinc_func)(const MYSQL_THD thd,
  24. unsigned long* off, unsigned long* inc);
  25. } *thd_autoinc_service;
  26. #ifdef MYSQL_DYNAMIC_PLUGIN
  27. #define thd_get_autoinc(thd, off, inc) \
  28. (thd_autoinc_service->thd_get_autoinc_func((thd), (off), (inc)))
  29. #else
  30. /**
  31. Return autoincrement system variables
  32. @param IN thd user thread connection handle
  33. @param OUT off the value of @@SESSION.auto_increment_offset
  34. @param OUT inc the value of @@SESSION.auto_increment_increment
  35. */
  36. void thd_get_autoinc(const MYSQL_THD thd,
  37. unsigned long* off, unsigned long* inc);
  38. #endif
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #define MYSQL_SERVICE_THD_AUTOINC_INCLUDED
  43. #endif