#include <database.mod/mariadb.mod/.bmx/mariadb.bmx.release.win32.x64.h>
struct BBString_1{BBClass_String* clas;BBULONG hash;int length;BBChar buf[1];};
struct BBString_3{BBClass_String* clas;BBULONG hash;int length;BBChar buf[3];};
struct BBString_10{BBClass_String* clas;BBULONG hash;int length;BBChar buf[10];};
struct BBString_6{BBClass_String* clas;BBULONG hash;int length;BBChar buf[6];};
struct BBString_21{BBClass_String* clas;BBULONG hash;int length;BBChar buf[21];};
struct BBString_20{BBClass_String* clas;BBULONG hash;int length;BBChar buf[20];};
struct BBString_28{BBClass_String* clas;BBULONG hash;int length;BBChar buf[28];};
struct BBString_25{BBClass_String* clas;BBULONG hash;int length;BBChar buf[25];};
struct BBString_27{BBClass_String* clas;BBULONG hash;int length;BBChar buf[27];};
struct BBString_24{BBClass_String* clas;BBULONG hash;int length;BBChar buf[24];};
struct BBString_30{BBClass_String* clas;BBULONG hash;int length;BBChar buf[30];};
struct BBString_26{BBClass_String* clas;BBULONG hash;int length;BBChar buf[26];};
struct BBString_7{BBClass_String* clas;BBULONG hash;int length;BBChar buf[7];};
struct BBString_8{BBClass_String* clas;BBULONG hash;int length;BBChar buf[8];};
struct BBString_18{BBClass_String* clas;BBULONG hash;int length;BBChar buf[18];};
struct BBString_4{BBClass_String* clas;BBULONG hash;int length;BBChar buf[4];};
struct BBString_5{BBClass_String* clas;BBULONG hash;int length;BBChar buf[5];};
struct BBString_9{BBClass_String* clas;BBULONG hash;int length;BBChar buf[9];};
static struct BBString_1 _s30={
	&bbStringClass,
	0xe7661a0566dadf97,
	1,
	{39}
};
static struct BBString_1 _s4={
	&bbStringClass,
	0x8a44f19b176dda60,
	1,
	{40}
};
static struct BBString_3 _s27={
	&bbStringClass,
	0x3140a020f3cd1e86,
	3,
	{59,10,10}
};
static struct BBString_10 _s35={
	&bbStringClass,
	0x9487aefe547bfaad,
	10,
	{66,69,71,73,78,32,87,79,82,75}
};
static struct BBString_6 _s1={
	&bbStringClass,
	0x2af6a1053207f7d7,
	6,
	{67,79,77,77,73,84}
};
static struct BBString_21 _s0={
	&bbStringClass,
	0xcff2c11abc28e22,
	21,
	{67,111,110,110,101,99,116,105,111,110,32,104,97,115,32,99,108
	,111,115,101,100}
};
static struct BBString_20 _s43={
	&bbStringClass,
	0xfb279be21f496686,
	20,
	{69,114,114,111,114,32,98,105,110,100,105,110,103,32,114,101,115
	,117,108,116}
};
static struct BBString_20 _s41={
	&bbStringClass,
	0x81ab11e270ec60a2,
	20,
	{69,114,114,111,114,32,98,105,110,100,105,110,103,32,118,97,108
	,117,101,115}
};
static struct BBString_28 _s2={
	&bbStringClass,
	0x98ccb0d8ca98ec90,
	28,
	{69,114,114,111,114,32,99,111,109,109,105,116,116,105,110,103,32
	,116,114,97,110,115,97,99,116,105,111,110}
};
static struct BBString_28 _s28={
	&bbStringClass,
	0xb0fcc98c873d3baa,
	28,
	{69,114,114,111,114,32,99,111,110,110,101,99,116,105,110,103,32
	,116,111,32,100,97,116,97,98,97,115,101}
};
static struct BBString_21 _s37={
	&bbStringClass,
	0x819ae39f4248698b,
	21,
	{69,114,114,111,114,32,101,120,101,99,117,116,105,110,103,32,113
	,117,101,114,121}
};
static struct BBString_25 _s42={
	&bbStringClass,
	0x97c2d963e4b94776,
	25,
	{69,114,114,111,114,32,101,120,101,99,117,116,105,110,103,32,115
	,116,97,116,101,109,101,110,116}
};
static struct BBString_27 _s31={
	&bbStringClass,
	0x1f63a083f44d1857,
	27,
	{69,114,114,111,114,32,105,110,105,116,105,97,108,105,122,105,110
	,103,32,100,97,116,97,98,97,115,101}
};
static struct BBString_24 _s29={
	&bbStringClass,
	0x8d09367a77520b14,
	24,
	{69,114,114,111,114,32,111,112,101,110,105,110,103,32,100,97,116
	,97,98,97,115,101,32,39}
};
static struct BBString_25 _s39={
	&bbStringClass,
	0x48fa39593b31d4a4,
	25,
	{69,114,114,111,114,32,112,114,101,112,97,114,105,110,103,32,115
	,116,97,116,101,109,101,110,116}
};
static struct BBString_25 _s40={
	&bbStringClass,
	0x31541e24c25d9aef,
	25,
	{69,114,114,111,114,32,114,101,115,101,116,116,105,110,103,32,115
	,116,97,116,101,109,101,110,116}
};
static struct BBString_30 _s34={
	&bbStringClass,
	0xa04557736a983af5,
	30,
	{69,114,114,111,114,32,114,111,108,108,105,110,103,32,98,97,99
	,107,32,116,114,97,110,115,97,99,116,105,111,110}
};
static struct BBString_26 _s36={
	&bbStringClass,
	0x2182482802d813a0,
	26,
	{69,114,114,111,114,32,115,116,97,114,116,105,110,103,32,116,114
	,97,110,115,97,99,116,105,111,110}
};
static struct BBString_20 _s44={
	&bbStringClass,
	0xf9fdffbeb9b2ee75,
	20,
	{69,114,114,111,114,32,115,116,111,114,105,110,103,32,114,101,115
	,117,108,116}
};
static struct BBString_24 _s38={
	&bbStringClass,
	0x84aabed3da3ff401,
	24,
	{69,114,114,111,114,32,115,116,111,114,105,110,103,32,114,101,115
	,117,108,116,32,115,101,116}
};
static struct BBString_7 _s45={
	&bbStringClass,
	0x8b926737d67c8748,
	7,
	{77,65,82,73,65,68,66}
};
static struct BBString_8 _s33={
	&bbStringClass,
	0xa61426338e4547af,
	8,
	{82,79,76,76,66,65,67,75}
};
static struct BBString_18 _s3={
	&bbStringClass,
	0x116a134af5e46bbe,
	18,
	{83,72,79,87,32,67,79,76,85,77,78,83,32,70,82,79,77
	,32}
};
static struct BBString_18 _s26={
	&bbStringClass,
	0x3cc82f707295545d,
	18,
	{83,72,79,87,32,67,82,69,65,84,69,32,84,65,66,76,69
	,32}
};
static struct BBString_3 _s25={
	&bbStringClass,
	0xd402b694b915d11e,
	3,
	{89,69,83}
};
static struct BBString_6 _s12={
	&bbStringClass,
	0x21cd128dca5051d7,
	6,
	{98,105,103,105,110,116}
};
static struct BBString_4 _s22={
	&bbStringClass,
	0xdec8f18e32f7e474,
	4,
	{98,108,111,98}
};
static struct BBString_4 _s6={
	&bbStringClass,
	0xfdc8889f7ba0e8fe,
	4,
	{98,111,111,108}
};
static struct BBString_7 _s5={
	&bbStringClass,
	0x4f9b275585d15f60,
	7,
	{98,111,111,108,101,97,110}
};
static struct BBString_4 _s17={
	&bbStringClass,
	0xb8f370f4cb5ba1e9,
	4,
	{100,97,116,101}
};
static struct BBString_8 _s19={
	&bbStringClass,
	0xfee099d8b564a225,
	8,
	{100,97,116,101,116,105,109,101}
};
static struct BBString_7 _s15={
	&bbStringClass,
	0x5d41b2b5bc1e8217,
	7,
	{100,101,99,105,109,97,108}
};
static struct BBString_6 _s14={
	&bbStringClass,
	0x71b58eac94f8019d,
	6,
	{100,111,117,98,108,101}
};
static struct BBString_5 _s16={
	&bbStringClass,
	0x6be68d0b4210ad1b,
	5,
	{102,108,111,97,116}
};
static struct BBString_3 _s10={
	&bbStringClass,
	0x97266e93bbc64ea,
	3,
	{105,110,116}
};
static struct BBString_7 _s11={
	&bbStringClass,
	0x2468c759d4a47b83,
	7,
	{105,110,116,101,103,101,114}
};
static struct BBString_8 _s24={
	&bbStringClass,
	0xb38bddb330eaa20b,
	8,
	{108,111,110,103,98,108,111,98}
};
static struct BBString_10 _s23={
	&bbStringClass,
	0x9f6d7dfadea4a0c3,
	10,
	{109,101,100,105,117,109,98,108,111,98}
};
static struct BBString_9 _s9={
	&bbStringClass,
	0xbffff0db006e612a,
	9,
	{109,101,100,105,117,109,105,110,116}
};
static struct BBString_4 _s13={
	&bbStringClass,
	0xd498e56c2ba94015,
	4,
	{114,101,97,108}
};
static struct BBString_8 _s8={
	&bbStringClass,
	0x4997ce8bec4ed83a,
	8,
	{115,109,97,108,108,105,110,116}
};
static struct BBString_4 _s20={
	&bbStringClass,
	0xecb7e1152c9d81aa,
	4,
	{116,105,109,101}
};
static struct BBString_9 _s18={
	&bbStringClass,
	0x324de41e8e81d549,
	9,
	{116,105,109,101,115,116,97,109,112}
};
static struct BBString_8 _s21={
	&bbStringClass,
	0x29ab605bcd990b56,
	8,
	{116,105,110,121,98,108,111,98}
};
static struct BBString_7 _s7={
	&bbStringClass,
	0xe7662fd902eb7dc7,
	7,
	{116,105,110,121,105,110,116}
};
static struct BBString_4 _s32={
	&bbStringClass,
	0x8995807a44783187,
	4,
	{117,116,102,56}
};
struct BBDebugScope_17{int kind; const char *name; BBDebugDecl decls[18]; };
struct BBDebugScope_2{int kind; const char *name; BBDebugDecl decls[3]; };
struct BBDebugScope_24{int kind; const char *name; BBDebugDecl decls[25]; };
struct BBDebugScope_7{int kind; const char *name; BBDebugDecl decls[8]; };
void _database_mariadb_TMariaDBDatabaseLoader_New(struct database_mariadb_TMariaDBDatabaseLoader_obj* o) {
	_database_core_TDatabaseLoader_New((struct database_core_TDatabaseLoader_obj*)o);
	o->clas = &database_mariadb_TMariaDBDatabaseLoader;
	o->_database_core_tdatabaseloader__type =((BBString*)&_s45);
}
struct database_core_TDBConnection_obj* _database_mariadb_TMariaDBDatabaseLoader_LoadDatabase_SSiSSSS(struct database_mariadb_TMariaDBDatabaseLoader_obj* o,BBSTRING bbt_dbname,BBSTRING bbt_host,BBINT bbt_port,BBSTRING bbt_user,BBSTRING bbt_password,BBSTRING bbt_server,BBSTRING bbt_options){
	return (struct database_core_TDBConnection_obj*)database_mariadb_TDBMariaDB_Create_TTDBConnection_SSiSSSS(bbt_dbname,bbt_host,bbt_port,bbt_user,bbt_password,bbt_server,bbt_options);
}
struct BBDebugScope_2 database_mariadb_TMariaDBDatabaseLoader_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TMariaDBDatabaseLoader",
	{
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMariaDBDatabaseLoader_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"LoadDatabase",
			"($,$,i,$,$,$,$):TDBConnection",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMariaDBDatabaseLoader_LoadDatabase_SSiSSSS
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_mariadb_TMariaDBDatabaseLoader database_mariadb_TMariaDBDatabaseLoader={
	&database_core_TDatabaseLoader,
	bbObjectFree,
	(BBDebugScope*)&database_mariadb_TMariaDBDatabaseLoader_scope,
	sizeof(struct database_mariadb_TMariaDBDatabaseLoader_obj),
	(void (*)(BBOBJECT))_database_mariadb_TMariaDBDatabaseLoader_New,
	bbObjectDtor,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	0
	,0
	,sizeof(void*)
	,_database_mariadb_TMariaDBDatabaseLoader_LoadDatabase_SSiSSSS
};

void _database_mariadb_TDBMariaDB_New(struct database_mariadb_TDBMariaDB_obj* o) {
	_database_core_TDBConnection_New((struct database_core_TDBConnection_obj*)o);
	o->clas = &database_mariadb_TDBMariaDB;
	o->_database_mariadb_tdbmariadb_clientversion = 0;
	o->_database_mariadb_tdbmariadb_serverversion = 0;
}
void _database_mariadb_TDBMariaDB_Delete(struct database_mariadb_TDBMariaDB_obj* o) {
	_database_core_TDBConnection_Delete((struct database_core_TDBConnection_obj*)o);
}
struct database_core_TDBConnection_obj* database_mariadb_TDBMariaDB_Create_TTDBConnection_SSiSSSS(BBSTRING bbt_dbname,BBSTRING bbt_host,BBINT bbt_port,BBSTRING bbt_user,BBSTRING bbt_password,BBSTRING bbt_server,BBSTRING bbt_options){
	struct database_mariadb_TDBMariaDB_obj* bbt_this=(struct database_mariadb_TDBMariaDB_obj*)(struct database_mariadb_TDBMariaDB_obj*)bbObjectNew((BBClass *)&database_mariadb_TDBMariaDB);
	(bbt_this)->clas->m_Init_SSiSSSS((struct database_core_TDBConnection_obj*)bbt_this,bbt_dbname,bbt_host,bbt_port,bbt_user,bbt_password,bbt_server,bbt_options);
	bbt_this->_database_mariadb_tdbmariadb_clientversion =mysql_get_client_version();
	if(bbt_this->_database_core_tdbconnection__dbname != &bbEmptyString){
		(bbt_this)->clas->m_open_SS((struct database_mariadb_TDBMariaDB_obj*)bbt_this,bbt_user,bbt_password);
	}
	return (struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)bbObjectDowncast((BBOBJECT)bbt_this,(BBClass*)&database_core_TDBConnection));
}
void _database_mariadb_TDBMariaDB_close(struct database_mariadb_TDBMariaDB_obj* o){
	if(o->_database_core_tdbconnection__isopen !=0){
		((struct database_core_TDBConnection_obj*)o)->clas->m_free((struct database_core_TDBConnection_obj*)o);
		mysql_close(o->_database_core_tdbconnection_handle );
		o->_database_core_tdbconnection_handle =0;
		o->_database_core_tdbconnection__isopen =0;
	}
}
BBINT _database_mariadb_TDBMariaDB_isOpen(struct database_mariadb_TDBMariaDB_obj* o){
	if(o->_database_core_tdbconnection__isopen !=0){
		if(mysql_ping(o->_database_core_tdbconnection_handle )!=0){
			((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s0),(&bbEmptyString),2,mysql_errno(o->_database_core_tdbconnection_handle ));
			o->_database_core_tdbconnection__isopen =0;
		}
	}
	return o->_database_core_tdbconnection__isopen ;
}
BBINT _database_mariadb_TDBMariaDB_commit(struct database_mariadb_TDBMariaDB_obj* o){
	if(!(o->_database_core_tdbconnection__isopen !=0)){
		return 0;
	}
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString((BBString*)&_s1);
	if(mysql_query(o->_database_core_tdbconnection_handle ,bbt_)!=0){
		bbMemFree(bbt_);
		((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s2),(&bbEmptyString),1,mysql_errno(o->_database_core_tdbconnection_handle ));
		return 0;
	}
	bbMemFree(bbt_);
	return 1;
}
BBARRAY _database_mariadb_TDBMariaDB_getTables(struct database_mariadb_TDBMariaDB_obj* o){
	BBARRAY bbt_list=(&bbEmptyArray);
	if(!(o->_database_core_tdbconnection__isopen !=0)){
		return bbt_list;
	}
	struct brl_linkedlist_TList_obj* bbt_tableList=(struct brl_linkedlist_TList_obj*)(struct brl_linkedlist_TList_obj*)bbObjectNew((BBClass *)&brl_linkedlist_TList);
	BBBYTE* bbt_tablesHandle=mysql_list_tables(o->_database_core_tdbconnection_handle ,0);
	if(bbt_tablesHandle){
		BBBYTE* bbt_row=mysql_fetch_row(bbt_tablesHandle);
		while(bbt_row){
			BBSTRING bbt_s=bbStringFromUTF8String(bmx_mysql_rowField_chars(bbt_row,0));
			(bbt_tableList)->clas->m_AddLast_TObject((struct brl_linkedlist_TList_obj*)bbt_tableList,(BBOBJECT)bbt_s);
			bbt_row=mysql_fetch_row(bbt_tablesHandle);
		}
		mysql_free_result(bbt_tablesHandle);
	}
	if((bbt_tableList)->clas->m_Count((struct brl_linkedlist_TList_obj*)bbt_tableList)>0){
		bbt_list=bbArrayNew1D("$", (bbt_tableList)->clas->m_Count((struct brl_linkedlist_TList_obj*)bbt_tableList));
		BBINT bbt_i=0;
		struct brl_linkedlist_TListEnum_obj* bbt_=(struct brl_linkedlist_TListEnum_obj*)(bbt_tableList)->clas->m_ObjectEnumerator((struct brl_linkedlist_TList_obj*)bbt_tableList);
		while((bbt_)->clas->m_HasNext((struct brl_linkedlist_TListEnum_obj*)bbt_)!=0){
			BBOBJECT bbt_2=(BBOBJECT)(bbt_)->clas->m_NextObject((struct brl_linkedlist_TListEnum_obj*)bbt_);
			if(bbObjectIsString((BBOBJECT)bbt_2)==0){
				continue;
			}
			BBSTRING bbt_s2=((BBString *)bbObjectStringcast((BBOBJECT)bbt_2));
			((BBSTRING*)BBARRAYDATA(bbt_list,1))[((BBUINT)bbt_i)]=bbt_s2;
			bbt_i+=1;
		}
	}
	return bbt_list;
}
struct database_core_TDBTable_obj* _database_mariadb_TDBMariaDB_getTableInfo_Si(struct database_mariadb_TDBMariaDB_obj* o,BBSTRING bbt_tableName,BBINT bbt_withDDL){
	if(!(o->_database_core_tdbconnection__isopen !=0)){
		return (struct database_core_TDBTable_obj*)&bbNullObject;
	}
	struct database_core_TDatabaseQuery_obj* bbt_query=(struct database_core_TDatabaseQuery_obj*)database_core_TDatabaseQuery_Create_TTDatabaseQuery_TTDBConnection((struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)bbObjectDowncast((BBOBJECT)o,(BBClass*)&database_core_TDBConnection)));
	struct database_core_TDBTable_obj* bbt_table=(struct database_core_TDBTable_obj*)((struct database_core_TDBTable_obj*)&bbNullObject);
	BBSTRING bbt_sql=bbStringConcat(((BBString*)&_s3),bbt_tableName);
	if((bbt_query)->clas->m_execute_S((struct database_core_TDatabaseQuery_obj*)bbt_query,bbt_sql)!=0){
		bbt_table=(struct database_core_TDBTable_obj*)(struct database_core_TDBTable_obj*)bbObjectNew((BBClass *)&database_core_TDBTable);
		bbt_table->_database_core_tdbtable_name =bbt_tableName;
		struct brl_linkedlist_TList_obj* bbt_cols=(struct brl_linkedlist_TList_obj*)(struct brl_linkedlist_TList_obj*)bbObjectNew((BBClass *)&brl_linkedlist_TList);
		struct database_core_TRowEnumerator_obj* bbt_=(struct database_core_TRowEnumerator_obj*)(bbt_query)->clas->m_ObjectEnumerator((struct database_core_TDatabaseQuery_obj*)bbt_query);
		while((bbt_)->clas->m_HasNext((struct database_core_TRowEnumerator_obj*)bbt_)!=0){
			struct database_core_TQueryRecord_obj* bbt_rec=(struct database_core_TQueryRecord_obj*)((struct database_core_TQueryRecord_obj*)bbObjectDowncast((BBOBJECT)(bbt_)->clas->m_NextObject((struct database_core_TRowEnumerator_obj*)bbt_),(BBClass*)&database_core_TQueryRecord));
			if(((BBOBJECT)bbt_rec)==&bbNullObject){
				continue;
			}
			BBSTRING bbt_name=(bbt_rec)->clas->m_getString_i((struct database_core_TQueryRecord_obj*)bbt_rec,0);
			BBARRAY bbt_2=bbStringSplit((BBSTRING)(bbt_rec)->clas->m_getString_i((struct database_core_TQueryRecord_obj*)bbt_rec,1),((BBString*)&_s4));
			BBSTRING bbt__type=((BBSTRING*)BBARRAYDATA(bbt_2,1))[0U];
			BBINT bbt_dbType=0;
			BBSTRING bbt_3=bbt__type;
			if((((((bbStringEquals(bbt_3, ((BBString*)&_s5))==1 || bbStringEquals(bbt_3, ((BBString*)&_s6))==1) || bbStringEquals(bbt_3, ((BBString*)&_s7))==1) || bbStringEquals(bbt_3, ((BBString*)&_s8))==1) || bbStringEquals(bbt_3, ((BBString*)&_s9))==1) || bbStringEquals(bbt_3, ((BBString*)&_s10))==1) || bbStringEquals(bbt_3, ((BBString*)&_s11))==1){
				bbt_dbType=2;
			}else{
				if(bbStringEquals(bbt_3, ((BBString*)&_s12))==1){
					bbt_dbType=5;
				}else{
					if((bbStringEquals(bbt_3, ((BBString*)&_s13))==1 || bbStringEquals(bbt_3, ((BBString*)&_s14))==1) || bbStringEquals(bbt_3, ((BBString*)&_s15))==1){
						bbt_dbType=3;
					}else{
						if(bbStringEquals(bbt_3, ((BBString*)&_s16))==1){
							bbt_dbType=4;
						}else{
							if(bbStringEquals(bbt_3, ((BBString*)&_s17))==1){
								bbt_dbType=6;
							}else{
								if(bbStringEquals(bbt_3, ((BBString*)&_s18))==1 || bbStringEquals(bbt_3, ((BBString*)&_s19))==1){
									bbt_dbType=8;
								}else{
									if(bbStringEquals(bbt_3, ((BBString*)&_s20))==1){
										bbt_dbType=9;
									}else{
										if(((bbStringEquals(bbt_3, ((BBString*)&_s21))==1 || bbStringEquals(bbt_3, ((BBString*)&_s22))==1) || bbStringEquals(bbt_3, ((BBString*)&_s23))==1) || bbStringEquals(bbt_3, ((BBString*)&_s24))==1){
											bbt_dbType=7;
										}else{
											bbt_dbType=1;
										}
									}
								}
							}
						}
					}
				}
			}
			BBINT bbt_nullable=0;
			if(bbStringEquals((bbt_rec)->clas->m_getString_i((struct database_core_TQueryRecord_obj*)bbt_rec,2), ((BBString*)&_s25))==1){
				bbt_nullable=1;
			}
			struct database_core_dbtypes_TDBType_obj* bbt_defaultValue=(struct database_core_dbtypes_TDBType_obj*)(bbt_rec)->clas->m_value_i((struct database_core_TQueryRecord_obj*)bbt_rec,4);
			(bbt_cols)->clas->m_AddLast_TObject((struct brl_linkedlist_TList_obj*)bbt_cols,(BBOBJECT)database_core_TDBColumn_Create_TTDBColumn_SiiTTDBType(bbt_name,bbt_dbType,bbt_nullable,(struct database_core_dbtypes_TDBType_obj*)bbt_defaultValue));
		}
		(bbt_table)->clas->m_SetCountColumns_i((struct database_core_TDBTable_obj*)bbt_table,(bbt_cols)->clas->m_Count((struct brl_linkedlist_TList_obj*)bbt_cols));
		BBINT bbt_i=0;
		struct brl_linkedlist_TListEnum_obj* bbt_4=(struct brl_linkedlist_TListEnum_obj*)(bbt_cols)->clas->m_ObjectEnumerator((struct brl_linkedlist_TList_obj*)bbt_cols);
		while((bbt_4)->clas->m_HasNext((struct brl_linkedlist_TListEnum_obj*)bbt_4)!=0){
			struct database_core_TDBColumn_obj* bbt_col=(struct database_core_TDBColumn_obj*)((struct database_core_TDBColumn_obj*)bbObjectDowncast((BBOBJECT)(bbt_4)->clas->m_NextObject((struct brl_linkedlist_TListEnum_obj*)bbt_4),(BBClass*)&database_core_TDBColumn));
			if(((BBOBJECT)bbt_col)==&bbNullObject){
				continue;
			}
			(bbt_table)->clas->m_SetColumn_iTTDBColumn((struct database_core_TDBTable_obj*)bbt_table,bbt_i,(struct database_core_TDBColumn_obj*)bbt_col);
			bbt_i+=1;
		}
		(bbt_cols)->clas->m_Clear((struct brl_linkedlist_TList_obj*)bbt_cols);
		if(bbt_withDDL!=0){
			bbt_sql=bbStringConcat(((BBString*)&_s26),bbt_tableName);
			if((bbt_query)->clas->m_execute_S((struct database_core_TDatabaseQuery_obj*)bbt_query,bbt_sql)!=0){
				struct database_core_TRowEnumerator_obj* bbt_5=(struct database_core_TRowEnumerator_obj*)(bbt_query)->clas->m_ObjectEnumerator((struct database_core_TDatabaseQuery_obj*)bbt_query);
				while((bbt_5)->clas->m_HasNext((struct database_core_TRowEnumerator_obj*)bbt_5)!=0){
					struct database_core_TQueryRecord_obj* bbt_rec2=(struct database_core_TQueryRecord_obj*)((struct database_core_TQueryRecord_obj*)bbObjectDowncast((BBOBJECT)(bbt_5)->clas->m_NextObject((struct database_core_TRowEnumerator_obj*)bbt_5),(BBClass*)&database_core_TQueryRecord));
					if(((BBOBJECT)bbt_rec2)==&bbNullObject){
						continue;
					}
					bbt_table->_database_core_tdbtable_ddl =bbStringConcat(bbt_table->_database_core_tdbtable_ddl ,(bbStringConcat((bbt_rec2)->clas->m_getString_i((struct database_core_TQueryRecord_obj*)bbt_rec2,1),((BBString*)&_s27))));
				}
			}
		}
	}
	return (struct database_core_TDBTable_obj*)bbt_table;
}
BBINT _database_mariadb_TDBMariaDB_open_SS(struct database_mariadb_TDBMariaDB_obj* o,BBSTRING bbt_user,BBSTRING bbt_pass){
	if(o->_database_core_tdbconnection__isopen !=0){
		((struct database_mariadb_TDBMariaDB_obj*)o)->clas->m_close((struct database_mariadb_TDBMariaDB_obj*)o);
	}
	if(bbt_user!= &bbEmptyString){
		o->_database_core_tdbconnection__user =bbt_user;
	}
	if(bbt_pass!= &bbEmptyString){
		o->_database_core_tdbconnection__password =bbt_pass;
	}
	o->_database_core_tdbconnection_handle =mysql_init(0);
	if(o->_database_core_tdbconnection_handle ){
		BBINT bbt_ret=0;
		BBBYTE* bbt_d=bbStringToUTF8String((BBSTRING)o->_database_core_tdbconnection__dbname );
		if(o->_database_core_tdbconnection__host != &bbEmptyString){
			BBBYTE* bbt_h=bbStringToUTF8String((BBSTRING)o->_database_core_tdbconnection__host );
			if(o->_database_core_tdbconnection__user != &bbEmptyString){
				BBBYTE* bbt_u=bbStringToUTF8String((BBSTRING)o->_database_core_tdbconnection__user );
				if(o->_database_core_tdbconnection__password != &bbEmptyString){
					BBBYTE* bbt_p=bbStringToUTF8String((BBSTRING)o->_database_core_tdbconnection__password );
					bbt_ret=mysql_real_connect(o->_database_core_tdbconnection_handle ,bbt_h,bbt_u,bbt_p,bbt_d,o->_database_core_tdbconnection__port ,0,bbStringToInt((BBSTRING)o->_database_core_tdbconnection__options ));
					bbMemFree((void*)bbt_p);
				}else{
					bbt_ret=mysql_real_connect(o->_database_core_tdbconnection_handle ,bbt_h,bbt_u,0,bbt_d,o->_database_core_tdbconnection__port ,0,bbStringToInt((BBSTRING)o->_database_core_tdbconnection__options ));
				}
				bbMemFree((void*)bbt_u);
			}else{
				bbt_ret=mysql_real_connect(o->_database_core_tdbconnection_handle ,bbt_h,0,0,bbt_d,o->_database_core_tdbconnection__port ,0,bbStringToInt((BBSTRING)o->_database_core_tdbconnection__options ));
			}
			bbMemFree((void*)bbt_h);
		}else{
			if(o->_database_core_tdbconnection__user != &bbEmptyString){
				BBBYTE* bbt_u2=bbStringToUTF8String((BBSTRING)o->_database_core_tdbconnection__user );
				if(o->_database_core_tdbconnection__password != &bbEmptyString){
					BBBYTE* bbt_p2=bbStringToUTF8String((BBSTRING)o->_database_core_tdbconnection__password );
					bbt_ret=mysql_real_connect(o->_database_core_tdbconnection_handle ,0,bbt_u2,bbt_p2,bbt_d,o->_database_core_tdbconnection__port ,0,bbStringToInt((BBSTRING)o->_database_core_tdbconnection__options ));
					bbMemFree((void*)bbt_p2);
				}else{
					bbt_ret=mysql_real_connect(o->_database_core_tdbconnection_handle ,0,bbt_u2,0,bbt_d,o->_database_core_tdbconnection__port ,0,bbStringToInt((BBSTRING)o->_database_core_tdbconnection__options ));
				}
				bbMemFree((void*)bbt_u2);
			}else{
				bbt_ret=mysql_real_connect(o->_database_core_tdbconnection_handle ,0,0,0,bbt_d,o->_database_core_tdbconnection__port ,0,bbStringToInt((BBSTRING)o->_database_core_tdbconnection__options ));
			}
		}
		if(!(bbt_ret!=0)){
			((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s28),bbStringFromUTF8String(mysql_error(o->_database_core_tdbconnection_handle )),2,mysql_errno(o->_database_core_tdbconnection_handle ));
			return 0;
		}
		BBBYTE* bbt_ = (BBBYTE*)bbStringToCString(o->_database_core_tdbconnection__dbname );
		if(mysql_select_db(o->_database_core_tdbconnection_handle ,(bbt_))!=0){
			bbMemFree(bbt_);
			((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,bbStringConcat(bbStringConcat(((BBString*)&_s29),o->_database_core_tdbconnection__dbname ),((BBString*)&_s30)),bbStringFromUTF8String(mysql_error(o->_database_core_tdbconnection_handle )),2,mysql_errno(o->_database_core_tdbconnection_handle ));
			return 0;
		}
		bbMemFree(bbt_);
	}else{
		((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s31),(&bbEmptyString),2,0);
		return 0;
	}
	if(o->_database_mariadb_tdbmariadb_clientversion >=50007){
		BBBYTE* bbt_2 = (BBBYTE*)bbStringToCString((BBString*)&_s32);
		mysql_set_character_set(o->_database_core_tdbconnection_handle ,bbt_2);
		bbMemFree(bbt_2);
	}
	o->_database_mariadb_tdbmariadb_serverversion =mysql_get_server_version(o->_database_core_tdbconnection_handle );
	o->_database_core_tdbconnection__isopen =1;
	return 1;
}
BBINT _database_mariadb_TDBMariaDB_rollback(struct database_mariadb_TDBMariaDB_obj* o){
	if(!(o->_database_core_tdbconnection__isopen !=0)){
		return 0;
	}
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString((BBString*)&_s33);
	if(mysql_query(o->_database_core_tdbconnection_handle ,bbt_)!=0){
		bbMemFree(bbt_);
		((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s34),(&bbEmptyString),1,mysql_errno(o->_database_core_tdbconnection_handle ));
		return 0;
	}
	bbMemFree(bbt_);
	return 1;
}
BBINT _database_mariadb_TDBMariaDB_startTransaction(struct database_mariadb_TDBMariaDB_obj* o){
	if(!(o->_database_core_tdbconnection__isopen !=0)){
		return 0;
	}
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString((BBString*)&_s35);
	if(mysql_query(o->_database_core_tdbconnection_handle ,bbt_)!=0){
		bbMemFree(bbt_);
		((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s36),(&bbEmptyString),1,mysql_errno(o->_database_core_tdbconnection_handle ));
		return 0;
	}
	bbMemFree(bbt_);
	return 1;
}
BBBYTE* _database_mariadb_TDBMariaDB_databaseHandle(struct database_mariadb_TDBMariaDB_obj* o){
	return o->_database_core_tdbconnection_handle ;
}
struct database_core_TQueryResultSet_obj* _database_mariadb_TDBMariaDB_createResultSet(struct database_mariadb_TDBMariaDB_obj* o){
	return (struct database_core_TQueryResultSet_obj*)database_mariadb_TMySQLResultSet_Create_TTQueryResultSet_TTDBConnectionS((struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)bbObjectDowncast((BBOBJECT)o,(BBClass*)&database_core_TDBConnection)),(&bbEmptyString));
}
BBSTRING _database_mariadb_TDBMariaDB_nativeErrorMessage_i(struct database_mariadb_TDBMariaDB_obj* o,BBINT bbt_err){
	return ((BBString*)&bbEmptyString);
}
BBINT _database_mariadb_TDBMariaDB_hasPrepareSupport(struct database_mariadb_TDBMariaDB_obj* o){
	return 1;
}
BBINT _database_mariadb_TDBMariaDB_hasTransactionSupport(struct database_mariadb_TDBMariaDB_obj* o){
	return 1;
}
struct BBDebugScope_17 database_mariadb_TDBMariaDB_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TDBMariaDB",
	{
		{
			BBDEBUGDECL_FIELD,
			"clientVersion",
			"i",
			.field_offset=offsetof(struct database_mariadb_TDBMariaDB_obj,_database_mariadb_tdbmariadb_clientversion)
		},
		{
			BBDEBUGDECL_FIELD,
			"serverVersion",
			"i",
			.field_offset=offsetof(struct database_mariadb_TDBMariaDB_obj,_database_mariadb_tdbmariadb_serverversion)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_New
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"($,$,i,$,$,$,$):TDBConnection",
			.func_ptr=(BBFuncPtr)&database_mariadb_TDBMariaDB_Create_TTDBConnection_SSiSSSS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"close",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_close
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"isOpen",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_isOpen
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"commit",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_commit
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getTables",
			"()[]$",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_getTables
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getTableInfo",
			"($,i):TDBTable",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_getTableInfo_Si
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"open",
			"($,$)i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_open_SS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rollback",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_rollback
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"startTransaction",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_startTransaction
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"databaseHandle",
			"()*b",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_databaseHandle
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"createResultSet",
			"():TQueryResultSet",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_createResultSet
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"nativeErrorMessage",
			"(i)$",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_nativeErrorMessage_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"hasPrepareSupport",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_hasPrepareSupport
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"hasTransactionSupport",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TDBMariaDB_hasTransactionSupport
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_mariadb_TDBMariaDB database_mariadb_TDBMariaDB={
	&database_core_TDBConnection,
	bbObjectFree,
	(BBDebugScope*)&database_mariadb_TDBMariaDB_scope,
	sizeof(struct database_mariadb_TDBMariaDB_obj),
	(void (*)(BBOBJECT))_database_mariadb_TDBMariaDB_New,
	(void (*)(BBOBJECT))_database_mariadb_TDBMariaDB_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_mariadb_TDBMariaDB_obj,_database_mariadb_tdbmariadb_serverversion) - offsetof(struct database_mariadb_TDBMariaDB_obj,_database_mariadb_tdbmariadb_clientversion) + sizeof(BBINT)
	,0
	,offsetof(struct database_mariadb_TDBMariaDB_obj,_database_mariadb_tdbmariadb_clientversion)
	,database_mariadb_TDBMariaDB_Create_TTDBConnection_SSiSSSS
	,_database_core_TDBConnection_Init_SSiSSSS
	,_database_mariadb_TDBMariaDB_close
	,_database_mariadb_TDBMariaDB_commit
	,_database_mariadb_TDBMariaDB_getTables
	,_database_mariadb_TDBMariaDB_getTableInfo_Si
	,_database_mariadb_TDBMariaDB_open_SS
	,_database_mariadb_TDBMariaDB_rollback
	,_database_mariadb_TDBMariaDB_startTransaction
	,_database_core_TDBConnection_executeQuery_S
	,_database_mariadb_TDBMariaDB_isOpen
	,_database_core_TDBConnection_getDatabaseName
	,_database_core_TDBConnection_getHost
	,_database_core_TDBConnection_getPortNumber
	,_database_core_TDBConnection_error
	,_database_core_TDBConnection_resetError
	,_database_core_TDBConnection_hasError
	,_database_core_TDBConnection_setError_SSii
	,_database_mariadb_TDBMariaDB_databaseHandle
	,_database_mariadb_TDBMariaDB_createResultSet
	,_database_mariadb_TDBMariaDB_nativeErrorMessage_i
	,_database_mariadb_TDBMariaDB_hasPrepareSupport
	,_database_mariadb_TDBMariaDB_hasTransactionSupport
	,_database_core_TDBConnection_free
};

void _database_mariadb_TMySQLField_New(struct database_mariadb_TMySQLField_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_mariadb_TMySQLField;
	o->_database_mariadb_tmysqlfield_mysqlfield = 0;
	o->_database_mariadb_tmysqlfield_datavalue = 0;
	o->_database_mariadb_tmysqlfield_datalength = 0;
	o->_database_mariadb_tmysqlfield_isnull = 0;
	o->_database_mariadb_tmysqlfield_flag = 0;
}
void _database_mariadb_TMySQLField_Delete(struct database_mariadb_TMySQLField_obj* o) {
	((struct database_mariadb_TMySQLField_obj*)o)->clas->m_clear((struct database_mariadb_TMySQLField_obj*)o);
	bbObjectDtor((BBOBJECT)o);
}
void _database_mariadb_TMySQLField_clear(struct database_mariadb_TMySQLField_obj* o){
	o->_database_mariadb_tmysqlfield_mysqlfield =0;
	if(o->_database_mariadb_tmysqlfield_datavalue ){
		bbMemFree((void*)o->_database_mariadb_tmysqlfield_datavalue );
		o->_database_mariadb_tmysqlfield_datavalue =0;
	}
	o->_database_mariadb_tmysqlfield_datalength =0;
	o->_database_mariadb_tmysqlfield_isnull =0;
}
struct BBDebugScope_7 database_mariadb_TMySQLField_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TMySQLField",
	{
		{
			BBDEBUGDECL_FIELD,
			"mySQLField",
			"*b",
			.field_offset=offsetof(struct database_mariadb_TMySQLField_obj,_database_mariadb_tmysqlfield_mysqlfield)
		},
		{
			BBDEBUGDECL_FIELD,
			"dataValue",
			"*b",
			.field_offset=offsetof(struct database_mariadb_TMySQLField_obj,_database_mariadb_tmysqlfield_datavalue)
		},
		{
			BBDEBUGDECL_FIELD,
			"dataLength",
			"e",
			.field_offset=offsetof(struct database_mariadb_TMySQLField_obj,_database_mariadb_tmysqlfield_datalength)
		},
		{
			BBDEBUGDECL_FIELD,
			"isNull",
			"b",
			.field_offset=offsetof(struct database_mariadb_TMySQLField_obj,_database_mariadb_tmysqlfield_isnull)
		},
		{
			BBDEBUGDECL_FIELD,
			"flag",
			"i",
			.field_offset=offsetof(struct database_mariadb_TMySQLField_obj,_database_mariadb_tmysqlfield_flag)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLField_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"clear",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLField_clear
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_mariadb_TMySQLField database_mariadb_TMySQLField={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_mariadb_TMySQLField_scope,
	sizeof(struct database_mariadb_TMySQLField_obj),
	(void (*)(BBOBJECT))_database_mariadb_TMySQLField_New,
	(void (*)(BBOBJECT))_database_mariadb_TMySQLField_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_mariadb_TMySQLField_obj,_database_mariadb_tmysqlfield_flag) - offsetof(struct database_mariadb_TMySQLField_obj,_database_mariadb_tmysqlfield_mysqlfield) + sizeof(BBINT)
	,0
	,offsetof(struct database_mariadb_TMySQLField_obj,_database_mariadb_tmysqlfield_mysqlfield)
	,_database_mariadb_TMySQLField_clear
};

void _database_mariadb_TMySQLResultSet_New(struct database_mariadb_TMySQLResultSet_obj* o) {
	_database_core_TQueryResultSet_New((struct database_core_TQueryResultSet_obj*)o);
	o->clas = &database_mariadb_TMySQLResultSet;
	o->_database_mariadb_tmysqlresultset_resulthandle = 0;
	o->_database_mariadb_tmysqlresultset_row = 0;
	o->_database_mariadb_tmysqlresultset_stmthandle = 0;
	o->_database_mariadb_tmysqlresultset_metahandle = 0;
	o->_database_mariadb_tmysqlresultset_preparedquery = 0;
	o->_database_mariadb_tmysqlresultset__rowsaffected = 0;
	o->_database_mariadb_tmysqlresultset_parameterbindings = 0;
	o->_database_mariadb_tmysqlresultset_selectbindings = 0;
	o->_database_mariadb_tmysqlresultset_mysqlfields = (&bbEmptyArray);
}
void _database_mariadb_TMySQLResultSet_Delete(struct database_mariadb_TMySQLResultSet_obj* o) {
	((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_free((struct database_mariadb_TMySQLResultSet_obj*)o);
	_database_core_TQueryResultSet_Delete((struct database_core_TQueryResultSet_obj*)o);
}
struct database_core_TQueryResultSet_obj* database_mariadb_TMySQLResultSet_Create_TTQueryResultSet_TTDBConnectionS(struct database_core_TDBConnection_obj* bbt_db,BBSTRING bbt_sql){
	struct database_mariadb_TMySQLResultSet_obj* bbt_this=(struct database_mariadb_TMySQLResultSet_obj*)(struct database_mariadb_TMySQLResultSet_obj*)bbObjectNew((BBClass *)&database_mariadb_TMySQLResultSet);
	(bbt_this)->clas->m_Init_TTDBConnectionS((struct database_core_TQueryResultSet_obj*)bbt_this,(struct database_core_TDBConnection_obj*)bbt_db,bbt_sql);
	bbt_this->_database_core_tqueryresultset_rec =(struct database_core_TQueryRecord_obj*)database_core_TQueryRecord_Create_TTQueryRecord();
	return (struct database_core_TQueryResultSet_obj*)((struct database_core_TQueryResultSet_obj*)bbObjectDowncast((BBOBJECT)bbt_this,(BBClass*)&database_core_TQueryResultSet));
}
BBINT _database_mariadb_TMySQLResultSet_executeQuery_S(struct database_mariadb_TMySQLResultSet_obj* o,BBSTRING bbt_statement){
	if(!((o->_database_core_tqueryresultset_conn )->clas->m_isOpen((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn )!=0)){
		return 0;
	}
	o->_database_mariadb_tmysqlresultset_preparedquery =0;
	BBBYTE* bbt_q=bbStringToUTF8String((BBSTRING)bbt_statement);
	BBINT bbt_query=mysql_real_query(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle ,bbt_q,strlen(bbt_q));
	bbMemFree((void*)bbt_q);
	if(bbt_query!=0){
		(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s37),bbStringFromUTF8String(mysql_error(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle )),3,mysql_errno(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle ));
		return 0;
	}
	o->_database_mariadb_tmysqlresultset_resulthandle =mysql_store_result(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle );
	if(!(o->_database_mariadb_tmysqlresultset_resulthandle ) && (mysql_field_count(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle )>0)){
		(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s38),bbStringFromUTF8String(mysql_error(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle )),3,mysql_errno(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle ));
		return 0;
	}
	BBINT bbt_fieldCount=mysql_field_count(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle );
	((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_initRecord_i((struct database_mariadb_TMySQLResultSet_obj*)o,bbt_fieldCount);
	BBLONG bbt_af=0LL;
	bmx_mysql_affected_rows(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle ,(&bbt_af));
	o->_database_mariadb_tmysqlresultset__rowsaffected =((BBINT)bbt_af);
	if(bbt_fieldCount!=0){
		{
			BBINT bbt_i=0;
			BBINT bbt_=bbt_fieldCount;
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				BBBYTE* bbt__field=mysql_fetch_field_direct(o->_database_mariadb_tmysqlresultset_resulthandle ,bbt_i);
				struct database_core_TQueryField_obj* bbt_qf=(struct database_core_TQueryField_obj*)database_core_TQueryField_Create_TTQueryField_Si(bmx_mysql_field_name(bbt__field),o->clas->f_dbTypeFromNative_i_Sii((&bbEmptyString),bmx_mysql_field_type(bbt__field),bmx_mysql_field_flags(bbt__field)));
				bbt_qf->_database_core_tqueryfield_length =((BBINT)bmx_mysql_field_length(bbt__field));
				bbt_qf->_database_core_tqueryfield_precision =bmx_mysql_field_decimals(bbt__field);
				(o->_database_core_tqueryresultset_rec )->clas->m_setField_iTTQueryField((struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec ,bbt_i,(struct database_core_TQueryField_obj*)bbt_qf);
			}
		}
	}
	o->_database_core_tqueryresultset__isactive =1;
	return 1;
}
BBINT _database_mariadb_TMySQLResultSet_prepare_S(struct database_mariadb_TMySQLResultSet_obj* o,BBSTRING bbt_statement){
	((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_cleanup((struct database_mariadb_TMySQLResultSet_obj*)o);
	if(!(bbt_statement!= &bbEmptyString) || ((bbt_statement->length)==0)){
		return 0;
	}
	if(!(o->_database_mariadb_tmysqlresultset_stmthandle )){
		o->_database_mariadb_tmysqlresultset_stmthandle =mysql_stmt_init(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle );
	}
	if(!(o->_database_mariadb_tmysqlresultset_stmthandle )){
		(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s39),bbStringFromUTF8String(mysql_error(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle )),3,mysql_errno(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle ));
		return 0;
	}
	BBBYTE* bbt_q=bbStringToUTF8String((BBSTRING)bbt_statement);
	BBINT bbt_result=mysql_stmt_prepare(o->_database_mariadb_tmysqlresultset_stmthandle ,bbt_q,strlen(bbt_q));
	bbMemFree((void*)bbt_q);
	if(bbt_result!=0){
		(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s39),bbStringFromUTF8String(mysql_stmt_error(o->_database_mariadb_tmysqlresultset_stmthandle )),3,mysql_errno(o->_database_mariadb_tmysqlresultset_stmthandle ));
		((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_cleanup((struct database_mariadb_TMySQLResultSet_obj*)o);
		return 0;
	}
	if(mysql_stmt_param_count(o->_database_mariadb_tmysqlresultset_stmthandle )>0){
		o->_database_mariadb_tmysqlresultset_parameterbindings =bmx_mysql_makeBindings(mysql_stmt_param_count(o->_database_mariadb_tmysqlresultset_stmthandle ));
	}
	if(!(o->_database_mariadb_tmysqlresultset_metahandle )){
		o->_database_mariadb_tmysqlresultset_metahandle =mysql_stmt_result_metadata(o->_database_mariadb_tmysqlresultset_stmthandle );
	}
	if(o->_database_mariadb_tmysqlresultset_metahandle ){
		BBINT bbt_fieldCount=mysql_num_fields(o->_database_mariadb_tmysqlresultset_metahandle );
		((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_initRecord_i((struct database_mariadb_TMySQLResultSet_obj*)o,bbt_fieldCount);
		o->_database_mariadb_tmysqlresultset_mysqlfields =bbArrayNew1D(":TMySQLField", bbt_fieldCount);
		o->_database_mariadb_tmysqlresultset_selectbindings =bmx_mysql_makeBindings(bbt_fieldCount);
		{
			BBINT bbt_i=0;
			BBINT bbt_=bbt_fieldCount;
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				BBBYTE* bbt__field=mysql_fetch_field(o->_database_mariadb_tmysqlresultset_metahandle );
				((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]=(struct database_mariadb_TMySQLField_obj*)(struct database_mariadb_TMySQLField_obj*)bbObjectAtomicNew((BBClass *)&database_mariadb_TMySQLField);
				((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_mysqlfield =bbt__field;
				((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datalength =(bmx_mysql_field_length(bbt__field)+1);
				BBSIZET bbt_size=bmx_mysql_length_for_field(bbt__field);
				((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue =bbMemAlloc((size_t)bbt_size);
				BBINT bbt_ty=bmx_mysql_field_type(bbt__field);
				struct database_core_TQueryField_obj* bbt_qf=(struct database_core_TQueryField_obj*)database_core_TQueryField_Create_TTQueryField_Si(bmx_mysql_field_name(bbt__field),o->clas->f_dbTypeFromNative_i_Sii((&bbEmptyString),bbt_ty,bmx_mysql_field_flags(bbt__field)));
				bbt_qf->_database_core_tqueryfield_length =((BBINT)bmx_mysql_field_length(bbt__field));
				bbt_qf->_database_core_tqueryfield_precision =bmx_mysql_field_decimals(bbt__field);
				(o->_database_core_tqueryresultset_rec )->clas->m_setField_iTTQueryField((struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec ,bbt_i,(struct database_core_TQueryField_obj*)bbt_qf);
				bmx_mysql_inbind(o->_database_mariadb_tmysqlresultset_selectbindings ,bbt_i,bbt__field,((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ,(&((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datalength ),((BBINT*)(&((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_isnull )),bbt_ty);
			}
		}
	}
	return 1;
}
BBINT _database_mariadb_TMySQLResultSet_execute(struct database_mariadb_TMySQLResultSet_obj* o){
	if(!(o->_database_mariadb_tmysqlresultset_preparedquery !=0)){
		return 0;
	}
	if(!(o->_database_mariadb_tmysqlresultset_stmthandle )){
		return 0;
	}
	o->_database_core_tqueryresultset_index =-1;
	BBINT bbt_result=0;
	bbt_result=bmx_mysql_stmt_reset(o->_database_mariadb_tmysqlresultset_stmthandle );
	if(bbt_result!=0){
		(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s40),bbStringFromUTF8String(mysql_stmt_error(o->_database_mariadb_tmysqlresultset_stmthandle )),3,mysql_errno(o->_database_mariadb_tmysqlresultset_stmthandle ));
		return 0;
	}
	BBARRAY bbt_values=o->_database_core_tqueryresultset_boundvalues ;
	BBINT bbt_paramCount=mysql_stmt_param_count(o->_database_mariadb_tmysqlresultset_stmthandle );
	BBARRAY bbt_strings=(&bbEmptyArray);
	BBARRAY bbt_times=(&bbEmptyArray);
	BBARRAY bbt_nulls=(&bbEmptyArray);
	if(bbt_paramCount==o->_database_core_tqueryresultset_bindcount ){
		bbt_strings=bbArrayNew1D("*b", bbt_paramCount);
		bbt_times=bbArrayNew1D("*b", bbt_paramCount);
		bbt_nulls=bbArrayNew1D("b", bbt_paramCount);
		{
			BBINT bbt_i=0;
			BBINT bbt_=bbt_paramCount;
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				BBINT bbt_isNull=0;
				BBBYTE* bbt_nullsPtr=0;
				struct database_core_dbtypes_TDBType_obj* bbt_2;
				if(!(((BBObject*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)])!= &bbNullObject) || (((bbt_2 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)])->clas)->m_isNull((struct database_core_dbtypes_TDBType_obj*)bbt_2)!=0)){
					bbt_isNull=1;
					((BBBYTE*)BBARRAYDATA(bbt_nulls,1))[((BBUINT)bbt_i)]=1;
					bbt_nullsPtr=(((BBBYTE*)BBARRAYDATA(bbt_nulls,1))+bbt_i);
				}
				struct database_core_dbtypes_TDBType_obj* bbt_4;
				BBINT bbt_3=((bbt_4 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)])->clas)->m_kind((struct database_core_dbtypes_TDBType_obj*)bbt_4);
				if(bbt_3==2){
					bmx_mysql_bind_int(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,(&((struct database_core_dbtypes_TDBInt_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBInt))->_database_core_dbtypes_tdbint_value ),bbt_nullsPtr);
				}else{
					if(bbt_3==4){
						bmx_mysql_bind_float(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,(&((struct database_core_dbtypes_TDBFloat_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBFloat))->_database_core_dbtypes_tdbfloat_value ),bbt_nullsPtr);
					}else{
						if(bbt_3==3){
							bmx_mysql_bind_double(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,(&((struct database_core_dbtypes_TDBDouble_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBDouble))->_database_core_dbtypes_tdbdouble_value ),bbt_nullsPtr);
						}else{
							if(bbt_3==5){
								bmx_mysql_bind_long(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,(&((struct database_core_dbtypes_TDBLong_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBLong))->_database_core_dbtypes_tdblong_value ),bbt_nullsPtr);
							}else{
								if(bbt_3==1){
									struct database_core_dbtypes_TDBType_obj* bbt_5;
									BBBYTE* bbt_s=bbStringToUTF8String((BBSTRING)((bbt_5 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)])->clas)->m_getString((struct database_core_dbtypes_TDBType_obj*)bbt_5));
									((BBBYTE**)BBARRAYDATA(bbt_strings,1))[((BBUINT)bbt_i)]=bbt_s;
									bmx_mysql_bind_string(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,bbt_s,strlen(bbt_s),bbt_nullsPtr);
								}else{
									if(bbt_3==7){
										bmx_mysql_bind_blob(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,((struct database_core_dbtypes_TDBBlob_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBBlob))->_database_core_dbtypes_tdbblob_value ,((struct database_core_dbtypes_TDBBlob_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBBlob))->_database_core_dbtypes_tdbblob__size ,bbt_nullsPtr);
									}else{
										if(bbt_3==6){
											struct database_core_dbtypes_TDBDate_obj* bbt_date=(struct database_core_dbtypes_TDBDate_obj*)((struct database_core_dbtypes_TDBDate_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBDate));
											((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i)]=bmx_mysql_makeTime();
											bmx_mysql_bind_date(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i)],(bbt_date)->clas->m_getYear((struct database_core_dbtypes_TDBDate_obj*)bbt_date),(bbt_date)->clas->m_getMonth((struct database_core_dbtypes_TDBDate_obj*)bbt_date),(bbt_date)->clas->m_getDay((struct database_core_dbtypes_TDBDate_obj*)bbt_date),bbt_nullsPtr);
										}else{
											if(bbt_3==8){
												struct database_core_dbtypes_TDBDateTime_obj* bbt_date2=(struct database_core_dbtypes_TDBDateTime_obj*)((struct database_core_dbtypes_TDBDateTime_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBDateTime));
												((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i)]=bmx_mysql_makeTime();
												bmx_mysql_bind_datetime(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i)],(bbt_date2)->clas->m_getYear((struct database_core_dbtypes_TDBDateTime_obj*)bbt_date2),(bbt_date2)->clas->m_getMonth((struct database_core_dbtypes_TDBDateTime_obj*)bbt_date2),(bbt_date2)->clas->m_getDay((struct database_core_dbtypes_TDBDateTime_obj*)bbt_date2),(bbt_date2)->clas->m_getHour((struct database_core_dbtypes_TDBDateTime_obj*)bbt_date2),(bbt_date2)->clas->m_getMinute((struct database_core_dbtypes_TDBDateTime_obj*)bbt_date2),(bbt_date2)->clas->m_getSecond((struct database_core_dbtypes_TDBDateTime_obj*)bbt_date2),bbt_nullsPtr);
											}else{
												if(bbt_3==9){
													struct database_core_dbtypes_TDBTime_obj* bbt_date3=(struct database_core_dbtypes_TDBTime_obj*)((struct database_core_dbtypes_TDBTime_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(bbt_values,1))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBTime));
													((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i)]=bmx_mysql_makeTime();
													bmx_mysql_bind_time(o->_database_mariadb_tmysqlresultset_parameterbindings ,bbt_i,((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i)],(bbt_date3)->clas->m_getHour((struct database_core_dbtypes_TDBTime_obj*)bbt_date3),(bbt_date3)->clas->m_getMinute((struct database_core_dbtypes_TDBTime_obj*)bbt_date3),(bbt_date3)->clas->m_getSecond((struct database_core_dbtypes_TDBTime_obj*)bbt_date3),bbt_nullsPtr);
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		bbt_result=bmx_mysql_stmt_bind_param(o->_database_mariadb_tmysqlresultset_stmthandle ,o->_database_mariadb_tmysqlresultset_parameterbindings );
		if(bbt_result!=0){
			(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s41),bbStringFromUTF8String(mysql_stmt_error(o->_database_mariadb_tmysqlresultset_stmthandle )),3,mysql_errno(o->_database_mariadb_tmysqlresultset_stmthandle ));
			{
				BBINT bbt_i2=0;
				BBINT bbt_6=bbt_paramCount;
				for(;(bbt_i2<bbt_6);bbt_i2=(bbt_i2+1)){
					if(((BBBYTE**)BBARRAYDATA(bbt_strings,1))[((BBUINT)bbt_i2)]){
						bbMemFree((void*)((BBBYTE**)BBARRAYDATA(bbt_strings,1))[((BBUINT)bbt_i2)]);
					}
					if(((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i2)]){
						bmx_mysql_deleteTime(((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i2)]);
					}
				}
			}
			return 0;
		}
	}
	bbt_result=mysql_stmt_execute(o->_database_mariadb_tmysqlresultset_stmthandle );
	if((bbt_strings!= &bbEmptyArray) || (bbt_times!= &bbEmptyArray)){
		{
			BBINT bbt_i3=0;
			BBINT bbt_7=bbt_paramCount;
			for(;(bbt_i3<bbt_7);bbt_i3=(bbt_i3+1)){
				if(((BBBYTE**)BBARRAYDATA(bbt_strings,1))[((BBUINT)bbt_i3)]){
					bbMemFree((void*)((BBBYTE**)BBARRAYDATA(bbt_strings,1))[((BBUINT)bbt_i3)]);
				}
				if(((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i3)]){
					bmx_mysql_deleteTime(((BBBYTE**)BBARRAYDATA(bbt_times,1))[((BBUINT)bbt_i3)]);
				}
			}
		}
	}
	if(bbt_result!=0){
		(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s42),bbStringFromUTF8String(mysql_stmt_error(o->_database_mariadb_tmysqlresultset_stmthandle )),3,mysql_errno(o->_database_mariadb_tmysqlresultset_stmthandle ));
		return 0;
	}
	BBLONG bbt_af=0LL;
	bmx_mysql_stmt_affected_rows(o->_database_mariadb_tmysqlresultset_stmthandle ,(&bbt_af));
	o->_database_mariadb_tmysqlresultset__rowsaffected =((BBINT)bbt_af);
	if(o->_database_mariadb_tmysqlresultset_metahandle ){
		bbt_result=bmx_mysql_stmt_bind_result(o->_database_mariadb_tmysqlresultset_stmthandle ,o->_database_mariadb_tmysqlresultset_selectbindings );
		if(bbt_result!=0){
			(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s43),bbStringFromUTF8String(mysql_stmt_error(o->_database_mariadb_tmysqlresultset_stmthandle )),3,mysql_errno(o->_database_mariadb_tmysqlresultset_stmthandle ));
			return 0;
		}
		bbt_result=mysql_stmt_store_result(o->_database_mariadb_tmysqlresultset_stmthandle );
		if(bbt_result!=0){
			(o->_database_core_tqueryresultset_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tqueryresultset_conn ,((BBString*)&_s44),bbStringFromUTF8String(mysql_stmt_error(o->_database_mariadb_tmysqlresultset_stmthandle )),3,mysql_errno(o->_database_mariadb_tmysqlresultset_stmthandle ));
			return 0;
		}
	}
	o->_database_core_tqueryresultset__isactive =1;
	return 1;
}
void _database_mariadb_TMySQLResultSet_initRecord_i(struct database_mariadb_TMySQLResultSet_obj* o,BBINT bbt_size){
	(o->_database_core_tqueryresultset_rec )->clas->m_clear((struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec );
	if(bbt_size>0){
		(o->_database_core_tqueryresultset_rec )->clas->m_Init_i((struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec ,bbt_size);
	}
	((struct database_core_TQueryResultSet_obj*)o)->clas->m_resetValues_i((struct database_core_TQueryResultSet_obj*)o,bbt_size);
}
BBINT _database_mariadb_TMySQLResultSet_firstRow(struct database_mariadb_TMySQLResultSet_obj* o){
	if(o->_database_core_tqueryresultset_index ==-1){
		return ((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_nextRow((struct database_mariadb_TMySQLResultSet_obj*)o);
	}
	return 0;
}
BBINT _database_mariadb_TMySQLResultSet_nextRow(struct database_mariadb_TMySQLResultSet_obj* o){
	if(o->_database_mariadb_tmysqlresultset_preparedquery !=0){
		if(!(o->_database_mariadb_tmysqlresultset_stmthandle )){
			return 0;
		}
		BBINT bbt_result=bmx_mysql_stmt_fetch(o->_database_mariadb_tmysqlresultset_stmthandle );
		if(bbt_result!=0){
			return 0;
		}
	}else{
		o->_database_mariadb_tmysqlresultset_row =mysql_fetch_row(o->_database_mariadb_tmysqlresultset_resulthandle );
		if(!(o->_database_mariadb_tmysqlresultset_row )){
			return 0;
		}
	}
	{
		BBINT bbt_i=0;
		BBINT bbt_=(o->_database_core_tqueryresultset_rec )->clas->m_count((struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec );
		for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
			if(((BBObject*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])!= &bbNullObject){
				struct database_core_dbtypes_TDBType_obj* bbt_2;
				((bbt_2 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_clear((struct database_core_dbtypes_TDBType_obj*)bbt_2);
			}
			if(o->_database_mariadb_tmysqlresultset_preparedquery !=0){
				if(!(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_isnull !=0)){
					BBINT bbt_fieldLength=((BBINT)((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datalength );
					BBINT bbt_3=((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_rec ->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_i)]->_database_core_tqueryfield_ftype ;
					if(bbt_3==2){
						((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBInt_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBInt),(BBClass*)&database_core_dbtypes_TDBType));
						struct database_core_dbtypes_TDBType_obj* bbt_4;
						((bbt_4 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_setInt_i((struct database_core_dbtypes_TDBType_obj*)bbt_4,bmx_mysql_char_to_int(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ));
					}else{
						if(bbt_3==5){
							((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBLong_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBLong),(BBClass*)&database_core_dbtypes_TDBType));
							struct database_core_dbtypes_TDBType_obj* bbt_5;
							((bbt_5 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_setLong_l((struct database_core_dbtypes_TDBType_obj*)bbt_5,bmx_mysql_char_to_long(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ));
						}else{
							if(bbt_3==4){
								((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBFloat_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBFloat),(BBClass*)&database_core_dbtypes_TDBType));
								struct database_core_dbtypes_TDBType_obj* bbt_6;
								((bbt_6 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_SetFloat_f((struct database_core_dbtypes_TDBType_obj*)bbt_6,bmx_mysql_char_to_float(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ));
							}else{
								if(bbt_3==3){
									((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBDouble_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBDouble),(BBClass*)&database_core_dbtypes_TDBType));
									struct database_core_dbtypes_TDBType_obj* bbt_7;
									((bbt_7 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_setDouble_d((struct database_core_dbtypes_TDBType_obj*)bbt_7,bmx_mysql_char_to_double(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ));
								}else{
									if(bbt_3==6){
										((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)bmx_mysql_char_to_date(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ),(BBClass*)&database_core_dbtypes_TDBType));
									}else{
										if(bbt_3==8){
											((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)bmx_mysql_char_to_datetime(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ),(BBClass*)&database_core_dbtypes_TDBType));
										}else{
											if(bbt_3==9){
												((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)bmx_mysql_char_to_time(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ),(BBClass*)&database_core_dbtypes_TDBType));
											}else{
												if(bbt_3==7){
													((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBBlob_Set_TTDBBlob_pbii(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ,bbt_fieldLength,1),(BBClass*)&database_core_dbtypes_TDBType));
												}else{
													((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBString_obj*)bbObjectNew((BBClass *)&database_core_dbtypes_TDBString),(BBClass*)&database_core_dbtypes_TDBType));
													struct database_core_dbtypes_TDBType_obj* bbt_8;
													((bbt_8 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_setString_S((struct database_core_dbtypes_TDBType_obj*)bbt_8,database_core_sizedUTF8toISO8859(((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]->_database_mariadb_tmysqlfield_datavalue ,bbt_fieldLength));
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}else{
				if(!(bmx_mysql_rowField_isNull(o->_database_mariadb_tmysqlresultset_row ,bbt_i)!=0)){
					BBULONGINT* bbt_9=mysql_fetch_lengths(o->_database_mariadb_tmysqlresultset_resulthandle );
					BBINT bbt_fieldLength2=((BBINT)bbt_9[bbt_i]);
					BBINT bbt_10=((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_rec ->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_i)]->_database_core_tqueryfield_ftype ;
					if(bbt_10==2){
						((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBInt_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBInt),(BBClass*)&database_core_dbtypes_TDBType));
						struct database_core_dbtypes_TDBType_obj* bbt_11;
						((bbt_11 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_setInt_i((struct database_core_dbtypes_TDBType_obj*)bbt_11,bbStringToInt((BBSTRING)bbStringFromBytes(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2)));
					}else{
						if(bbt_10==5){
							((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBLong_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBLong),(BBClass*)&database_core_dbtypes_TDBType));
							struct database_core_dbtypes_TDBType_obj* bbt_12;
							((bbt_12 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_setLong_l((struct database_core_dbtypes_TDBType_obj*)bbt_12,bbStringToLong((BBSTRING)bbStringFromBytes(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2)));
						}else{
							if(bbt_10==4){
								((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBFloat_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBFloat),(BBClass*)&database_core_dbtypes_TDBType));
								struct database_core_dbtypes_TDBType_obj* bbt_13;
								((bbt_13 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_SetFloat_f((struct database_core_dbtypes_TDBType_obj*)bbt_13,bbStringToFloat((BBSTRING)bbStringFromBytes(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2)));
							}else{
								if(bbt_10==3){
									((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBDouble_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBDouble),(BBClass*)&database_core_dbtypes_TDBType));
									struct database_core_dbtypes_TDBType_obj* bbt_14;
									((bbt_14 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_setDouble_d((struct database_core_dbtypes_TDBType_obj*)bbt_14,bbStringToDouble((BBSTRING)bbStringFromBytes(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2)));
								}else{
									if(bbt_10==6){
										((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBDate_SetFromString_TTDBDate_S(bbStringFromUTF8Bytes(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2)),(BBClass*)&database_core_dbtypes_TDBType));
									}else{
										if(bbt_10==8){
											((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBDateTime_SetFromString_TTDBDateTime_S(bbStringFromUTF8Bytes(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2)),(BBClass*)&database_core_dbtypes_TDBType));
										}else{
											if(bbt_10==9){
												((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBTime_SetFromString_TTDBTime_S(bbStringFromUTF8Bytes(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2)),(BBClass*)&database_core_dbtypes_TDBType));
											}else{
												if(bbt_10==7){
													((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBBlob_Set_TTDBBlob_pbii(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2,1),(BBClass*)&database_core_dbtypes_TDBType));
												}else{
													((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBString_obj*)bbObjectNew((BBClass *)&database_core_dbtypes_TDBString),(BBClass*)&database_core_dbtypes_TDBType));
													struct database_core_dbtypes_TDBType_obj* bbt_15;
													((bbt_15 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_setString_S((struct database_core_dbtypes_TDBType_obj*)bbt_15,bbStringFromUTF8Bytes(bmx_mysql_rowField_chars(o->_database_mariadb_tmysqlresultset_row ,bbt_i),bbt_fieldLength2));
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	o->_database_core_tqueryresultset_index +=1;
	return 1;
}
BBLONG _database_mariadb_TMySQLResultSet_lastInsertedId(struct database_mariadb_TMySQLResultSet_obj* o){
	if(!(((struct database_core_TQueryResultSet_obj*)o)->clas->m_isActive((struct database_core_TQueryResultSet_obj*)o)!=0)){
		return -1LL;
	}
	BBLONG bbt_id=-1LL;
	if(o->_database_mariadb_tmysqlresultset_preparedquery !=0){
		bmx_mysql_stmt_insert_id(o->_database_mariadb_tmysqlresultset_stmthandle ,(&bbt_id));
	}else{
		bmx_mysql_insert_id(o->_database_core_tqueryresultset_conn ->_database_core_tdbconnection_handle ,(&bbt_id));
	}
	return bbt_id;
}
BBINT _database_mariadb_TMySQLResultSet_rowsAffected(struct database_mariadb_TMySQLResultSet_obj* o){
	return o->_database_mariadb_tmysqlresultset__rowsaffected ;
}
BBINT database_mariadb_TMySQLResultSet_dbTypeFromNative_i_Sii(BBSTRING bbt_name,BBINT bbt__type,BBINT bbt__flags){
	BBINT bbt_dbType=0;
	BBINT bbt_=bbt__type;
	if((((bbt_==1) || (bbt_==2)) || (bbt_==3)) || (bbt_==9)){
		bbt_dbType=2;
	}else{
		if(bbt_==13){
			bbt_dbType=2;
		}else{
			if(bbt_==8){
				bbt_dbType=5;
			}else{
				if(bbt_==4){
					bbt_dbType=4;
				}else{
					if((bbt_==5) || (bbt_==0)){
						bbt_dbType=3;
					}else{
						if(bbt_==10){
							bbt_dbType=6;
						}else{
							if(bbt_==11){
								bbt_dbType=9;
							}else{
								if((bbt_==12) || (bbt_==7)){
									bbt_dbType=8;
								}else{
									if((((bbt_==252) || (bbt_==249)) || (bbt_==250)) || (bbt_==251)){
										if(((unsigned int)(bbt__flags)&(unsigned int)(128))!=0){
											bbt_dbType=7;
										}else{
											bbt_dbType=1;
										}
									}else{
										bbt_dbType=1;
									}
								}
							}
						}
					}
				}
			}
		}
	}
	return bbt_dbType;
}
void _database_mariadb_TMySQLResultSet_cleanup(struct database_mariadb_TMySQLResultSet_obj* o){
	if(o->_database_mariadb_tmysqlresultset_resulthandle ){
		mysql_free_result(o->_database_mariadb_tmysqlresultset_resulthandle );
		o->_database_mariadb_tmysqlresultset_resulthandle =0;
	}
	if(o->_database_mariadb_tmysqlresultset_metahandle ){
		mysql_free_result(o->_database_mariadb_tmysqlresultset_metahandle );
		o->_database_mariadb_tmysqlresultset_metahandle =0;
	}
	if(o->_database_mariadb_tmysqlresultset_stmthandle ){
		if(bmx_mysql_stmt_close(o->_database_mariadb_tmysqlresultset_stmthandle )!=0){
		}
		o->_database_mariadb_tmysqlresultset_stmthandle =0;
	}
	if(o->_database_mariadb_tmysqlresultset_parameterbindings ){
		bmx_mysql_deleteBindings(o->_database_mariadb_tmysqlresultset_parameterbindings );
		o->_database_mariadb_tmysqlresultset_parameterbindings =0;
	}
	if(o->_database_mariadb_tmysqlresultset_selectbindings ){
		bmx_mysql_deleteBindings(o->_database_mariadb_tmysqlresultset_selectbindings );
		o->_database_mariadb_tmysqlresultset_selectbindings =0;
	}
	if(o->_database_mariadb_tmysqlresultset_mysqlfields != &bbEmptyArray){
		{
			BBINT bbt_i=0;
			BBINT bbt_=(o->_database_mariadb_tmysqlresultset_mysqlfields ->scales[0]);
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				if(((BBObject*)((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)])!= &bbNullObject){
					struct database_mariadb_TMySQLField_obj* bbt_2;
					((bbt_2 = ((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)])->clas)->m_clear((struct database_mariadb_TMySQLField_obj*)bbt_2);
					((struct database_mariadb_TMySQLField_obj**)BBARRAYDATA(o->_database_mariadb_tmysqlresultset_mysqlfields ,1))[((BBUINT)bbt_i)]=(struct database_mariadb_TMySQLField_obj*)&bbNullObject;
				}
			}
		}
	}
	o->_database_core_tqueryresultset_index =-1;
	(o->_database_core_tqueryresultset_rec )->clas->m_clear((struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec );
	o->_database_core_tqueryresultset__isactive =0;
	o->_database_mariadb_tmysqlresultset_preparedquery =1;
}
void _database_mariadb_TMySQLResultSet_clear(struct database_mariadb_TMySQLResultSet_obj* o){
	((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_cleanup((struct database_mariadb_TMySQLResultSet_obj*)o);
	(&database_mariadb_TMySQLResultSet)->super->m_clear((struct database_core_TQueryResultSet_obj*)o);
}
void _database_mariadb_TMySQLResultSet_reset(struct database_mariadb_TMySQLResultSet_obj* o){
	((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_clear((struct database_mariadb_TMySQLResultSet_obj*)o);
}
void _database_mariadb_TMySQLResultSet_free(struct database_mariadb_TMySQLResultSet_obj* o){
	((struct database_mariadb_TMySQLResultSet_obj*)o)->clas->m_clear((struct database_mariadb_TMySQLResultSet_obj*)o);
}
struct BBDebugScope_24 database_mariadb_TMySQLResultSet_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TMySQLResultSet",
	{
		{
			BBDEBUGDECL_FIELD,
			"resultHandle",
			"*b",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_resulthandle)
		},
		{
			BBDEBUGDECL_FIELD,
			"row",
			"*b",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_row)
		},
		{
			BBDEBUGDECL_FIELD,
			"stmtHandle",
			"*b",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_stmthandle)
		},
		{
			BBDEBUGDECL_FIELD,
			"metaHandle",
			"*b",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_metahandle)
		},
		{
			BBDEBUGDECL_FIELD,
			"preparedQuery",
			"i",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_preparedquery)
		},
		{
			BBDEBUGDECL_FIELD,
			"_rowsAffected",
			"i",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset__rowsaffected)
		},
		{
			BBDEBUGDECL_FIELD,
			"parameterBindings",
			"*b",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_parameterbindings)
		},
		{
			BBDEBUGDECL_FIELD,
			"selectBindings",
			"*b",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_selectbindings)
		},
		{
			BBDEBUGDECL_FIELD,
			"mySQLFields",
			"[]:TMySQLField",
			.field_offset=offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_mysqlfields)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_New
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"(:TDBConnection,$):TQueryResultSet",
			.func_ptr=(BBFuncPtr)&database_mariadb_TMySQLResultSet_Create_TTQueryResultSet_TTDBConnectionS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"executeQuery",
			"($)i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_executeQuery_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"prepare",
			"($)i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_prepare_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"execute",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_execute
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"initRecord",
			"(i)",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_initRecord_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"firstRow",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_firstRow
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"nextRow",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_nextRow
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"lastInsertedId",
			"()l",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_lastInsertedId
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rowsAffected",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_rowsAffected
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"dbTypeFromNative",
			"($,i,i)i",
			.func_ptr=(BBFuncPtr)&database_mariadb_TMySQLResultSet_dbTypeFromNative_i_Sii
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"cleanup",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_cleanup
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"clear",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_clear
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"reset",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_reset
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"free",
			"()",
			.func_ptr=(BBFuncPtr)&_database_mariadb_TMySQLResultSet_free
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_mariadb_TMySQLResultSet database_mariadb_TMySQLResultSet={
	&database_core_TQueryResultSet,
	bbObjectFree,
	(BBDebugScope*)&database_mariadb_TMySQLResultSet_scope,
	sizeof(struct database_mariadb_TMySQLResultSet_obj),
	(void (*)(BBOBJECT))_database_mariadb_TMySQLResultSet_New,
	(void (*)(BBOBJECT))_database_mariadb_TMySQLResultSet_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_mysqlfields) - offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_resulthandle) + sizeof(BBARRAY)
	,0
	,offsetof(struct database_mariadb_TMySQLResultSet_obj,_database_mariadb_tmysqlresultset_resulthandle)
	,database_mariadb_TMySQLResultSet_Create_TTQueryResultSet_TTDBConnectionS
	,_database_core_TQueryResultSet_Init_TTDBConnectionS
	,_database_core_TQueryResultSet_clearBindValues
	,_database_mariadb_TMySQLResultSet_clear
	,_database_mariadb_TMySQLResultSet_executeQuery_S
	,_database_mariadb_TMySQLResultSet_prepare_S
	,_database_mariadb_TMySQLResultSet_execute
	,_database_mariadb_TMySQLResultSet_firstRow
	,_database_mariadb_TMySQLResultSet_nextRow
	,_database_mariadb_TMySQLResultSet_lastInsertedId
	,_database_mariadb_TMySQLResultSet_rowsAffected
	,database_mariadb_TMySQLResultSet_dbTypeFromNative_i_Sii
	,_database_core_TQueryResultSet_rowRecord
	,_database_core_TQueryResultSet_dataValue_i
	,_database_core_TQueryResultSet_rowIndex
	,_database_core_TQueryResultSet_setRowIndex_i
	,_database_core_TQueryResultSet_isActive
	,_database_core_TQueryResultSet_isValid
	,_database_core_TQueryResultSet_resetValues_i
	,_database_core_TQueryResultSet_resetBindCount
	,_database_core_TQueryResultSet_addBindValue_TTDBType
	,_database_core_TQueryResultSet_bindValue_iTTDBType
	,_database_mariadb_TMySQLResultSet_reset
	,_database_mariadb_TMySQLResultSet_free
	,_database_mariadb_TMySQLResultSet_initRecord_i
	,_database_mariadb_TMySQLResultSet_cleanup
};

static int __bb_database_mariadb_mariadb_inited = 0;
int __bb_database_mariadb_mariadb(){
	if (!__bb_database_mariadb_mariadb_inited) {
		__bb_database_mariadb_mariadb_inited = 1;
		__bb_brl_blitz_blitz();
		_bb_database_mariadb_common();
		bbObjectRegisterType((BBCLASS)&database_mariadb_TMariaDBDatabaseLoader);
		bbObjectRegisterType((BBCLASS)&database_mariadb_TDBMariaDB);
		bbObjectRegisterType((BBCLASS)&database_mariadb_TMySQLField);
		bbObjectRegisterType((BBCLASS)&database_mariadb_TMySQLResultSet);
		database_core_AddDatabaseLoader((struct database_core_TDatabaseLoader_obj*)((struct database_core_TDatabaseLoader_obj*)bbObjectDowncast((BBOBJECT)(struct database_mariadb_TMariaDBDatabaseLoader_obj*)bbObjectNew((BBClass *)&database_mariadb_TMariaDBDatabaseLoader),(BBClass*)&database_core_TDatabaseLoader)));
		return 0;
	}
	return 0;
}