#include <stdio.h>#include <string.h>#include <mysql/mysql.h>#include <mysql/errmsg.h>#include "../../basext.h"Go to the source code of this file.
Data Structures | |
| struct | _mymysqlHANDLE |
| struct | _myOBJECT |
Defines | |
| #define | VERSION323 1 |
| #define | MAXERR 7 |
| #define | MYSQL_ERROR_LVAL 0x00081001 |
| #define | MYSQL_ERROR_SEEK 0x00081002 |
| #define | MYSQL_ERROR_SEKO 0x00081003 |
| #define | MYSQL_ERROR_NORS 0x00081004 |
| #define | MYSQL_ERROR_NOCN 0x00081005 |
| #define | MYSQL_ERROR_BDCN 0x00081006 |
| #define | GET_DB_HANDLE |
| #define | CONFLEN 100 |
| #define | CONFROOT "mysql.connections." |
| #define | MAXKL 20 |
Typedefs | |
| typedef _mymysqlHANDLE | mymysqlHANDLE |
| typedef _mymysqlHANDLE * | pmymysqlHANDLE |
| typedef _myOBJECT | myOBJECT |
| typedef _myOBJECT * | pmyOBJECT |
Functions | |
| static int | convert_error (int iMyError) |
| besSUB_ERRMSG | if (iError< 0x80000+MAXERR &&iError > 0x80000) return errtxt[iError-0x80000] |
| besEND besVERSION_NEGOTIATE | return (int) |
| besFUNCTION (mys_affected_rows) | |
| besEND | besFUNCTION (mys_get_host_info) |
| besEND | besFUNCTION (mys_get_server_info) |
| besEND | besFUNCTION (mys_stat) |
| besEND | besFUNCTION (mys_thread_id) |
| besEND | besFUNCTION (mys_get_proto_info) |
| besEND | besFUNCTION (mys_change_user) |
| besDEREFERENCE (Argument) | |
| if (Argument) | |
| if (pszUser) | |
| if (row==NULL) | |
| if (lengths==NULL) | |
| for (i=0;((unsigned) i)< numfields;i++) | |
| LONGVALUE (besRETURNVALUE) | |
| besEND | besFUNCTION (mys_fetchhash) |
| if (field==NULL) | |
| besEND | besFUNCTION (mys_query) |
| if (!Argument) return EX_ERROR_TOO_FEW_ARGUMENTS | |
| if (iMyError!=0) | |
| besEND | besFUNCTION (mys_close) |
| if (besARGNR > 4) | |
| if (besARGNR > 5) | |
| if (besARGNR > 6) | |
| if (pszHost) | |
| if (pH==NULL) | |
| strcpy (szConfigPath, CONFROOT) | |
| if (STRLEN(Argument) > CONFLEN-strlen(CONFROOT)-MAXKL) return MYSQL_ERROR_BDCN | |
| memcpy (pszConf, STRINGVALUE(Argument), STRLEN(Argument)) | |
| strcpy (pszConf,"host") | |
| strcpy (pszConf,"user") | |
| strcpy (pszConf,"password") | |
| strcpy (pszConf,"db") | |
| strcpy (pszConf,"port") | |
| besCONFIGEX (pSt->pEo->pConfig, szConfigPath, NULL, NULL,&lPort, NULL, NULL) | |
| strcpy (pszConf,"socket") | |
| if (pszUnixSocket &&*pszUnixSocket==(char) 0) pszUnixSocket | |
| strcpy (pszConf,"flag") | |
| if (q) | |
Variables | |
| static int | err_conv_table [] |
| static char * | errtxt [] |
| else return | NULL |
| return | |
| else | besRETURNVALUE = NULL |
| else | besRETURNVALUE = NULL |
| else | besRETURNVALUE = NULL |
| else | besRETURNVALUE = NULL |
| else | besRETURNVALUE = NULL |
| else | pszUser = NULL |
| Argument = besARGUMENT(3) | |
| else | pszPassword = NULL |
| Argument = besARGUMENT(4) | |
| else | pszDB = NULL |
| iError = mysql_change_user(q->hSQL,pszUser,pszPassword,pszDB) | |
| * | Lval = besNEWARRAY(0,numfields-1) |
| if Lval return | COMMAND_ERROR_MEMORY_LOW |
| row = mysql_fetch_row(q->result) | |
| lengths = mysql_fetch_lengths(q->result) | |
| besALLOC_RETURN_LONG | |
| * | Lval = besNEWARRAY(0,2*numfields-1) |
| if Lval return | COMMAND_ERROR_MEMORY_LOW |
| field = mysql_fetch_fields(q->result) | |
| row = mysql_fetch_row(q->result) | |
| lengths = mysql_fetch_lengths(q->result) | |
| besALLOC_RETURN_LONG | |
| Argument = besARGUMENT(2) | |
| Argument = besCONVERT2STRING(Argument) | |
| iMyError = mysql_real_query(q->hSQL,STRINGVALUE(Argument),STRLEN(Argument)) | |
| q | num_fields = mysql_num_fields(q->result) |
| besRETURNVALUE = NULL | |
| else | pszHost = NULL |
| Argument = besARGUMENT(2) | |
| else | pszUser = NULL |
| Argument = besARGUMENT(3) | |
| else | pszPassword = NULL |
| Argument = besARGUMENT(4) | |
| else | pszDB = NULL |
| q = mysql_real_connect(pH->hSQL,pszHost,pszUser,pszPassword,pszDB,lPort,pszUnixSocket,lClientFlag) | |
| int | iMyError |
| pmymysqlHANDLE | pH |
| VARIABLE | Argument |
| char * | pszHost |
| char * | pszUser |
| char * | pszPassword |
| char * | pszDB |
| char * | pszUnixSocket |
| long | lPort |
| long | lClientFlag |
| pmyOBJECT | p |
| char | szConfigPath [CONFLEN] |
| char * | pszConf |
| char * | pszCname |
| p = (pmyOBJECT)besMODULEPOINTER | |
| pH = besALLOC(sizeof(mymysqlHANDLE)) | |
| else return | MYSQL_ERROR_NOCN |
| pszConf = szConfigPath + strlen(szConfigPath) | |
| pszConf = STRLEN(Argument) | |
| * | pszConf = '.' |
| pszHost = besCONFIG(szConfigPath) | |
| pszUser = besCONFIG(szConfigPath) | |
| pszPassword = besCONFIG(szConfigPath) | |
| pszDB = besCONFIG(szConfigPath) | |
| pszUnixSocket = besCONFIG(szConfigPath) | |
| q = mysql_real_connect(pH->hSQL,pszHost,pszUser,pszPassword,pszDB,(int)lPort,pszUnixSocket,lClientFlag) | |
|
|
Definition at line 768 of file interface.c. |
|
|
Definition at line 769 of file interface.c. |
|
|
Value: p = (pmyOBJECT)besMODULEPOINTER;\ Argument = besARGUMENT(1);\ besDEREFERENCE(Argument);\ if( Argument == NULL )return EX_ERROR_TOO_FEW_ARGUMENTS;\ q = besHandleGetPointer(p->HandleArray,besGETLONGVALUE(Argument));\ if( q == NULL )return COMMAND_ERROR_ARGUMENT_RANGE; Definition at line 128 of file interface.c. |
|
|
Definition at line 49 of file interface.c. |
|
|
Definition at line 770 of file interface.c. |
|
|
Definition at line 81 of file interface.c. |
|
|
Definition at line 71 of file interface.c. |
|
|
Definition at line 79 of file interface.c. |
|
|
Definition at line 77 of file interface.c. |
|
|
Definition at line 73 of file interface.c. |
|
|
Definition at line 75 of file interface.c. |
|
|
Definition at line 21 of file interface.c. |
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||||||
|
Referenced by time_out_work_thread(). |
|
|
|
|
|
Definition at line 622 of file interface.c. References besCONVERT2ZCHAR(). |
|
|
Definition at line 586 of file interface.c. References mysql_free_result(), and q. |
|
|
Definition at line 515 of file interface.c. References COMMAND_ERROR_SUCCESS. |
|
|
Definition at line 391 of file interface.c. References besCONVERT2ZCHAR(). |
|
|
Definition at line 231 of file interface.c. |
|
|
Definition at line 204 of file interface.c. References besALLOC_RETURN_STRING(), memcpy(), STRINGVALUE(), and STRLEN(). |
|
|
Definition at line 189 of file interface.c. References besALLOC_RETURN_STRING(), besRETURNVALUE, memcpy(), STRINGVALUE(), and STRLEN(). |
|
|
Definition at line 174 of file interface.c. References besALLOC_RETURN_STRING(), besRETURNVALUE, memcpy(), STRINGVALUE(), and STRLEN(). |
|
|
Definition at line 159 of file interface.c. References besALLOC_RETURN_STRING(), besRETURNVALUE, memcpy(), STRINGVALUE(), and STRLEN(). |
|
|
Definition at line 138 of file interface.c. References besALLOC_RETURN_STRING(), besRETURNVALUE, memcpy(), STRINGVALUE(), and STRLEN(). |
|
|
Definition at line 62 of file interface.c. References err_conv_table, and i. |
|
|
Definition at line 506 of file interface.c. |
|
|
Definition at line 834 of file interface.c. References COMMAND_ERROR_SUCCESS, LONGVALUE(), _mymysqlHANDLE::next, p, pH, and _mymysqlHANDLE::prev. |
|
|
|
|
||||||||||||
|
|
|
|
Definition at line 777 of file interface.c. |
|
|
Definition at line 738 of file interface.c. |
|
||||||||||||
|
Definition at line 727 of file interface.c. References besDEREFERENCE(), lClientFlag, LONGVALUE(), and MYSQL_PORT. |
|
||||||||||||
|
Definition at line 718 of file interface.c. References besCONVERT2ZCHAR(), besDEREFERENCE(), and pszUnixSocket. |
|
||||||||||||
|
Definition at line 709 of file interface.c. References besDEREFERENCE(), LONGVALUE(), lPort, and MYSQL_PORT. |
|
|
Definition at line 611 of file interface.c. |
|
|
|
|
|
Definition at line 554 of file interface.c. References COMMAND_ERROR_SUCCESS. |
|
|
Definition at line 501 of file interface.c. References COMMAND_ERROR_SUCCESS. |
|
|
Definition at line 495 of file interface.c. References COMMAND_ERROR_SUCCESS. |
|
|
Definition at line 428 of file interface.c. |
|
|
Definition at line 411 of file interface.c. References besCONVERT2ZCHAR(), and pszPassword. |
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
Definition at line 91 of file interface.c. |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
Definition at line 764 of file interface.c. |
|
|
Definition at line 703 of file interface.c. |
|
|
Definition at line 696 of file interface.c. |
|
|
Definition at line 688 of file interface.c. |
|
|
Definition at line 608 of file interface.c. |
|
|
Definition at line 604 of file interface.c. |
|
|
Definition at line 416 of file interface.c. |
|
|
Definition at line 409 of file interface.c. |
|
|
Definition at line 582 of file interface.c. |
|
|
Definition at line 511 of file interface.c. |
|
|
Definition at line 619 of file interface.c. |
|
|
Definition at line 228 of file interface.c. |
|
|
Definition at line 201 of file interface.c. |
|
|
Definition at line 186 of file interface.c. |
|
|
Definition at line 171 of file interface.c. |
|
|
Definition at line 156 of file interface.c. |
|
|
Definition at line 551 of file interface.c. |
|
|
|
Initial value: {
CR_CONN_HOST_ERROR,
CR_CONNECTION_ERROR,
CR_IPSOCK_ERROR,
CR_OUT_OF_MEMORY,
CR_SOCKET_CREATE_ERROR,
CR_UNKNOWN_HOST,
CR_VERSION_ERROR,
0
}
Definition at line 38 of file interface.c. Referenced by convert_error(). |
|
|
Initial value: {
"Connection to host error",
"Connection error",
"IP socket error",
"Out of memory error",
"Socket create error",
"Unknown host error",
"Version error",
NULL
}
Definition at line 51 of file interface.c. |
|
|
Definition at line 553 of file interface.c. |
|
|
Definition at line 423 of file interface.c. |
|
|
Definition at line 761 of file interface.c. |
|
|
Definition at line 610 of file interface.c. |
|
|
Definition at line 766 of file interface.c. Referenced by if(). |
|
|
Definition at line 566 of file interface.c. |
|
|
Definition at line 500 of file interface.c. |
|
|
Definition at line 766 of file interface.c. Referenced by if(). |
|
|
Definition at line 550 of file interface.c. |
|
|
Definition at line 490 of file interface.c. |
|
|
Definition at line 792 of file interface.c. |
|
|
|
Definition at line 618 of file interface.c. |
|
|
Definition at line 774 of file interface.c. |
|
|
Definition at line 767 of file interface.c. |
|
|
Definition at line 776 of file interface.c. |
|
|
Definition at line 763 of file interface.c. Referenced by besFUNCTION(), and if(). |
|
|
Definition at line 772 of file interface.c. |
|
|
Definition at line 801 of file interface.c. |
|
|
Definition at line 800 of file interface.c. |
|
|
Definition at line 797 of file interface.c. |
|
|
Definition at line 771 of file interface.c. |
|
|
Definition at line 817 of file interface.c. |
|
|
Definition at line 765 of file interface.c. |
|
|
Definition at line 707 of file interface.c. |
|
|
Definition at line 420 of file interface.c. |
|
|
Definition at line 805 of file interface.c. |
|
|
Definition at line 765 of file interface.c. |
|
|
Definition at line 685 of file interface.c. |
|
|
Definition at line 813 of file interface.c. |
|
|
Definition at line 765 of file interface.c. |
|
|
Definition at line 700 of file interface.c. |
|
|
Definition at line 413 of file interface.c. Referenced by if(). |
|
|
Definition at line 825 of file interface.c. |
|
|
Definition at line 765 of file interface.c. Referenced by if(). |
|
|
Definition at line 809 of file interface.c. |
|
|
Definition at line 765 of file interface.c. |
|
|
Definition at line 692 of file interface.c. |
|
|
Definition at line 405 of file interface.c. Referenced by if(). |
|
|
Definition at line 832 of file interface.c. |
|
|
Definition at line 736 of file interface.c. |
|
|
Definition at line 125 of file interface.c. |
|
|
Definition at line 560 of file interface.c. |
|
|
Definition at line 494 of file interface.c. |
|
|
Definition at line 771 of file interface.c. |
1.4.6-NO