My Project
|
00001 /* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; version 2 of the License. 00006 00007 This program is distributed in the hope that it will be useful, 00008 but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 GNU General Public License for more details. 00011 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software Foundation, 00014 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 00015 00016 #ifndef _sql_cursor_h_ 00017 #define _sql_cursor_h_ 00018 00019 #include "sql_class.h" /* Query_arena */ 00020 00021 class JOIN; 00022 00038 class Server_side_cursor: protected Query_arena, public Sql_alloc 00039 { 00040 protected: 00042 select_result *result; 00043 public: 00044 Server_side_cursor(MEM_ROOT *mem_root_arg, select_result *result_arg) 00045 :Query_arena(mem_root_arg, STMT_INITIALIZED), result(result_arg) 00046 {} 00047 00048 virtual bool is_open() const= 0; 00049 00050 virtual int open(JOIN *top_level_join)= 0; 00051 virtual void fetch(ulong num_rows)= 0; 00052 virtual void close()= 0; 00053 virtual ~Server_side_cursor(); 00054 00055 static void operator delete(void *ptr, size_t size); 00056 }; 00057 00058 00059 bool mysql_open_cursor(THD *thd, select_result *result, 00060 Server_side_cursor **res); 00061 00062 #endif /* _sql_cusor_h_ */