2001-04-20 19:00 GMT+3 Alexander Kresin <alex@belacy.belgorod.su>

This commit is contained in:
Alexander S.Kresin
2001-04-20 15:03:37 +00:00
parent b828880be3
commit 99aa934ff6
5 changed files with 426 additions and 502 deletions

View File

@@ -1,3 +1,14 @@
2001-04-20 19:00 GMT+3 Alexander Kresin <alex@belacy.belgorod.su>
* contrib/libmisc/dbftools.c
* fieldtype() fixed accordingly to RDD changes
* contrib/mysql/mysql.c
* sqlConnect() fixed for version older than 3.22.34
+ added support for mysql_affected_rows() and mysql_field_count()
* tests/db_brows.ch
* tests/db_brows.prg
* some improvements
2001-04-20 16:30 CET Martin Vogel <vogel@inttec.de>
+ contrib/libct/charop.c

View File

@@ -46,7 +46,24 @@ HB_FUNC( FIELDTYPE )
pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();
pField = pArea->lpFields + uiField - 1;
hb_retc( ( char * ) &( pField->uiType ) );
switch( pField->uiType )
{
case HB_IT_STRING:
hb_retc( "C" );
break;
case HB_IT_LONG:
hb_retc( "N" );
break;
case HB_IT_DATE:
hb_retc( "D" );
break;
case HB_IT_LOGICAL:
hb_retc( "L" );
break;
case HB_IT_MEMO:
hb_retc( "M" );
break;
}
}
HB_FUNC( FIELDSIZE )

View File

@@ -70,18 +70,27 @@
HB_FUNC(SQLCONNECT) // MYSQL *mysql_real_connect(MYSQL*, char * host, char * user, char * password, char * db, uint port, char *, uint flags)
{
MYSQL * mysql = NULL;
MYSQL * mysql;
#if MYSQL_VERSION_ID > 32200
/* from 3.22.x of MySQL there is a new parameter in mysql_real_connect() call, that is char * db
which is not used here */
if ( (mysql = mysql_init((MYSQL*) 0)) )
mysql_real_connect( mysql, _parc(1), _parc(2), _parc(3), NULL, 0, NULL, 0);
if ( (mysql = mysql_init((MYSQL*) 0)) )
{
if( mysql_real_connect( mysql, _parc(1), _parc(2), _parc(3), NULL, 0, NULL, 0) )
_retnl((long) mysql);
else
{
mysql_close( mysql );
_retnl( 0 );
}
}
else
_retnl( 0 );
#else
mysql = mysql_real_connect(NULL, _parc(1), _parc(2), _parc(3), 0, NULL, 0);
#endif
mysql = mysql_real_connect(NULL, _parc(1), _parc(2), _parc(3), 0, NULL, 0);
_retnl((long) mysql);
#endif
}
@@ -220,6 +229,10 @@ HB_FUNC(SQLNUMFI) // unsigned int mysql_num_fields(MYSQL_RES *)
_retnl(mysql_num_fields(((MYSQL_RES *)_parnl(1))));
}
HB_FUNC(SQLFICOU) // unsigned int mysql_num_fields(MYSQL_RES *)
{
_retnl(mysql_field_count(((MYSQL *)_parnl(1))));
}
HB_FUNC(SQLLISTF) // MYSQL_RES *mysql_list_fields(MYSQL *, char *);
{
@@ -294,3 +307,7 @@ HB_FUNC(SQLAND)
_retnl(_parnl(1) & _parnl(2));
}
HB_FUNC(SQLAFFROWS)
{
_retnl( mysql_affected_rows( (MYSQL *)_parnl(1) ) );
}

View File

@@ -2,29 +2,46 @@
* $Id$
*/
// Header file for db_brows.prg
#define KLRECF 200
#define LI_LEN 24
#define LI_NSTR mslist[1]
#define LI_CLR mslist[2] // Color of a window
#define LI_CLRV mslist[3] // Color of a current line
#define LI_BSKIP mslist[4] // Codeblock for a 'skip' operation
#define LI_BGTOP mslist[5] // Codeblock for a 'go top'
#define LI_BGBOT mslist[6] // Codeblock for a 'go bottom'
#define LI_BEOF mslist[7] // Codeblock for a 'eof' checking
#define LI_BBOF mslist[8] // Codeblock for a 'bof' checking
#define LI_B1 mslist[9]
#define LI_MSF mslist[10] // Array of codeblocks for columns
#define LI_NAMES mslist[11] // Array of the fields names
#define LI_NMCLR mslist[12] // Color of field names line
#define LI_FREEZE mslist[13] // Number of fields to 'freeze' from left
#define LI_RCOU mslist[14]
#define LI_MSREC mslist[15]
#define LI_PRFLT mslist[16]
#define LI_TEKZP mslist[17]
#define LI_KOLZ mslist[18]
#define LI_VALID mslist[19] // Array of codeblocks for postvalidation while changing a field
#define LI_WHEN mslist[20] // Array of codeblocks for prevalidation while changing a field
#define LI_MSNAME mslist[21]
#define LI_MSTYP mslist[22]
#define LI_MSLEN mslist[23]
#define LI_MSDEC mslist[24]
#define LI_LEN 42
#define LI_NSTR mslist[1]
#define LI_CLR mslist[2] // Color of a window
#define LI_CLRV mslist[3] // Color of a current line
#define LI_BSKIP mslist[4] // Codeblock for a 'skip' operation
#define LI_BGTOP mslist[5] // Codeblock for a 'go top'
#define LI_BGBOT mslist[6] // Codeblock for a 'go bottom'
#define LI_BEOF mslist[7] // Codeblock for a 'eof' checking
#define LI_BBOF mslist[8] // Codeblock for a 'bof' checking
#define LI_B1 mslist[9]
#define LI_MSF mslist[10] // Array of codeblocks for columns
#define LI_NAMES mslist[11] // Array of the fields names
#define LI_NMCLR mslist[12] // Color of field names line
#define LI_FREEZE mslist[13] // Number of fields to 'freeze' from left
#define LI_RCOU mslist[14]
#define LI_MSREC mslist[15]
#define LI_PRFLT mslist[16]
#define LI_TEKZP mslist[17]
#define LI_KOLZ mslist[18]
#define LI_VALID mslist[19] // Array of codeblocks for postvalidation while changing a field
#define LI_WHEN mslist[20] // Array of codeblocks for prevalidation while changing a field
#define LI_MSNAME mslist[21]
#define LI_MSTYP mslist[22]
#define LI_MSLEN mslist[23]
#define LI_MSDEC mslist[24]
#define LI_EXPFI mslist[25]
#define LI_BDESHIN mslist[26]
#define LI_BDESHOUT mslist[27]
#define LI_RECNO mslist[28]
#define LI_BGOTO mslist[29]
#define LI_Y1 mslist[30]
#define LI_X1 mslist[31]
#define LI_Y2 mslist[32]
#define LI_X2 mslist[33]
#define LI_LSOHR mslist[34]
#define LI_LVIEW mslist[35]
#define LI_NCOLUMNS mslist[36]
#define LI_LEFTVISIBLE mslist[37]
#define LI_NLEFT mslist[38]
#define LI_COLPOS mslist[39]
#define LI_XPOS mslist[40]
#define LI_MSED mslist[41]
#define LI_COLCOUNT mslist[42]

File diff suppressed because it is too large Load Diff