See changelog 2002-05-24 08:50 UTC-0300

This commit is contained in:
Luiz Rafael Culik
2002-05-24 12:06:31 +00:00
parent ae1f26ca19
commit 1901edc1ce
2 changed files with 24 additions and 4 deletions

View File

@@ -343,14 +343,23 @@ HB_FUNC(SQLSRVINFO)
_retc( mysql_get_server_info( (MYSQL *)_parnl(1) ) );
}
#ifdef __GNUC__
int filelength( int handle )
{
int nEnd = hb_fsSeek( handle, 0 , 2 );
int nStart = hb_fsSeek( handle , 0 , 0 );
return nEnd - nStart;
}
#endif
char *filetoBuff(char *f,char *s)
{
/* int i=0; */
int i;
int fh= hb_fsOpen((BYTE*)s,2);
i=hb_fsReadLarge(fh,(BYTE*)f,filelength(fh));
int fh = hb_fsOpen( ( BYTE * ) s , 2 );
i = hb_fsReadLarge( fh , ( BYTE * ) f , filelength( fh ) );
f[ i ] = '\0';
hb_fsClose(fh);
hb_fsClose( fh );
return f ;
}

View File

@@ -743,6 +743,7 @@ CLASS TMySQLServer
METHOD NetErr() INLINE ::lError // Returns .T. if something went wrong
METHOD Error() // Returns textual description of last error
METHOD CreateDatabase( cDataBase ) // Create an New Mysql Database
ENDCLASS
@@ -780,6 +781,16 @@ METHOD SelectDB(cDBName) CLASS TMySQLServer
return .F.
METHOD CreateDatabase ( cDataBase ) CLASS TMySQLServer
local cCreateQuery := "CREATE DATABASE "+ lower(cDatabase)
if sqlQuery(::nSocket, cCreateQuery) == 0
return .T.
endif
return .F.
// NOTE: OS/2 port of MySQL is picky about table names, that is if you create a table with
// an upper case name you cannot alter it (for example) using a lower case name, this violates
// OS/2 case insensibility about names