mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 23:49:22 +02:00
+ Merged changes from fixbranch
This commit is contained in:
parent
1089401672
commit
6019317548
@ -19,12 +19,8 @@ Const mysqllib = 'mysqlclient';
|
||||
{$ifndef win32}
|
||||
{$linklib c}
|
||||
{$linklib m}
|
||||
{ You need to specify the path to libgcc on the command line. }
|
||||
{ On my machine this is '-k-L/usr/lib/gcc-lib/i486-linux/2.7.2.1' }
|
||||
{$linklib gcc}
|
||||
{$endif}
|
||||
|
||||
|
||||
{ All is 4-byte aligned on my machine. }
|
||||
{$packrecords 4}
|
||||
|
||||
@ -40,7 +36,6 @@ Var
|
||||
mysql_unix_port : pchar; external name 'mysql_unix_port';
|
||||
{$endif}
|
||||
|
||||
|
||||
{
|
||||
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
|
||||
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
|
||||
@ -64,6 +59,12 @@ PMYSQL_FIELD = ^TMYSQL_FIELD;
|
||||
TMYSQL_ROW = PPchar; { return data as array of strings }
|
||||
TMYSQL_FIELD_OFFSET = cardinal; { offset to current field }
|
||||
|
||||
{$ifndef oldmysql}
|
||||
my_ulonglong=qword;
|
||||
{$else}
|
||||
my_longlong=cardinal;
|
||||
{$endif}
|
||||
|
||||
PST_MYSQL_Rows = ^st_mysql_rows;
|
||||
st_mysql_rows = Record
|
||||
next : pst_mysql_rows; { list of rows }
|
||||
@ -76,7 +77,8 @@ PMYSQL_ROWS = ^TMYSQL_ROWS;
|
||||
TMYSQL_ROW_OFFSET = PMYSQL_ROWS; { offset to current row }
|
||||
|
||||
st_mysql_data = record
|
||||
rows, fields : cardinal;
|
||||
rows : my_ulonglong;
|
||||
fields : cardinal;
|
||||
data : PMYSQL_ROWS;
|
||||
alloc : TMEM_ROOT;
|
||||
end;
|
||||
@ -84,33 +86,44 @@ end;
|
||||
TMYSQL_DATA = st_mysql_data;
|
||||
PMYSQL_DATA = ^TMYSQL_DATA;
|
||||
|
||||
st_mysql_options = record
|
||||
connect_timeout,client_flag : cardinal;
|
||||
compress,named_pipe : my_bool;
|
||||
port : cardinal;
|
||||
host,init_command,user,password,unix_socket,db : pchar;
|
||||
my_cnf_file,my_cnf_group : pchar;
|
||||
end;
|
||||
|
||||
mysql_status = (MYSQL_STATUS_READY,
|
||||
MYSQL_STATUS_GET_RESULT,
|
||||
MYSQL_STATUS_USE_RESULT);
|
||||
|
||||
|
||||
st_mysql = Record
|
||||
net : TNET; { Communication parameters }
|
||||
host,user,passwd,unix_socket,server_version,host_info, info,db : pchar;
|
||||
NET : TNET; { Communication parameters }
|
||||
host,user,passwd,unix_socket,server_version,host_info,
|
||||
info,db : pchar;
|
||||
port,client_flag,server_capabilities : cardinal;
|
||||
protocol_version : cardinal;
|
||||
field_count : cardinal;
|
||||
thread_id : cardinal; { Id for connection in server }
|
||||
affected_rows : cardinal;
|
||||
insert_id : cardinal; { id if insert on table with NEXTNR }
|
||||
extra_info : cardinal; { Used by mysqlshow }
|
||||
affected_rows : my_ulonglong;
|
||||
insert_id : my_ulonglong; { id if insert on table with NEXTNR }
|
||||
extra_info : my_ulonglong; { Used by mysqlshow }
|
||||
packet_length : cardinal;
|
||||
status : mysql_status;
|
||||
fields : PMYSQL_FIELD;
|
||||
field_alloc : TMEM_ROOT;
|
||||
free_me : my_bool; { If free in mysql_close }
|
||||
reconnect : my_bool; { set to 1 if automatic reconnect }
|
||||
options : st_mysql_options;
|
||||
end;
|
||||
TMYSQL = st_mysql;
|
||||
PMYSQL = ^TMYSQL;
|
||||
|
||||
|
||||
st_mysql_res = record
|
||||
row_count : cardinal;
|
||||
row_count : my_ulonglong;
|
||||
field_count, current_field : cardinal;
|
||||
fields : PMYSQL_FIELD;
|
||||
data : PMYSQL_DATA;
|
||||
@ -128,15 +141,15 @@ PMYSQL_RES = ^TMYSQL_RES;
|
||||
|
||||
{ Translated Macros }
|
||||
|
||||
Function mysql_num_rows (res : PMYSQL_RES) : Cardinal;
|
||||
Function mysql_num_rows (res : PMYSQL_RES) : my_ulonglong;
|
||||
Function mysql_num_fields(res : PMYSQL_RES) : Cardinal;
|
||||
Function mysql_eof(res : PMYSQL_RES) : my_bool;
|
||||
Function mysql_fetch_field_direct(res : PMYSQL_RES; fieldnr : Cardinal) : TMYSQL_FIELD;
|
||||
Function mysql_fetch_fields(res : PMYSQL_RES) : PMYSQL_FIELD;
|
||||
Function mysql_row_tell(res : PMYSQL_RES) : PMYSQL_ROWS;
|
||||
Function mysql_field_tell(res : PMYSQL_RES) : Cardinal;
|
||||
Function mysql_affected_rows(mysql : PMYSQL): Cardinal;
|
||||
Function mysql_insert_id(mysql : PMYSQL): Cardinal;
|
||||
Function mysql_affected_rows(mysql : PMYSQL): my_ulonglong;
|
||||
Function mysql_insert_id(mysql : PMYSQL): my_ulonglong;
|
||||
Function mysql_errno(mysql : PMYSQL) : Cardinal;
|
||||
Function mysql_info(mysql : PMYSQL): Pchar;
|
||||
Function mysql_reload(mysql : PMYSQL) : Longint;
|
||||
@ -228,7 +241,7 @@ begin
|
||||
mysql_error:=mysql^.net.last_error
|
||||
end;
|
||||
|
||||
Function mysql_num_rows (res : PMYSQL_RES) : Cardinal;
|
||||
Function mysql_num_rows (res : PMYSQL_RES) : my_ulonglong;
|
||||
|
||||
begin
|
||||
mysql_num_rows:=res^.row_count
|
||||
@ -272,11 +285,15 @@ end;
|
||||
|
||||
Function mysql_affected_rows(mysql : PMYSQL): Cardinal;
|
||||
|
||||
<<<<<<< mysql.pp
|
||||
=======
|
||||
Function mysql_affected_rows(mysql : PMYSQL): my_ulonglong;
|
||||
>>>>>>> 1.1.2.1
|
||||
begin
|
||||
mysql_affected_rows:=mysql^.affected_rows
|
||||
end;
|
||||
|
||||
Function mysql_insert_id(mysql : PMYSQL): Cardinal;
|
||||
Function mysql_insert_id(mysql : PMYSQL): my_ulonglong;
|
||||
|
||||
begin
|
||||
mysql_insert_id:=mysql^.insert_id
|
||||
@ -306,8 +323,11 @@ begin
|
||||
mysql_thread_id:=mysql^.thread_id
|
||||
end;
|
||||
|
||||
end. $Log$
|
||||
end. Revision 1.2 2000-07-13 11:33:26 michael
|
||||
end. + removed logs
|
||||
end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.3 2000-12-02 15:24:37 michael
|
||||
+ Merged changes from fixbranch
|
||||
|
||||
}
|
@ -83,13 +83,20 @@ Const
|
||||
MYSQL_ERRMSG_SIZE = 200;
|
||||
|
||||
Type
|
||||
net_type = (NET_TYPE_TCPIP, NET_TYPE_SOCKET, NETTYPE_NAMEDPIPE);
|
||||
st_net = record
|
||||
nettype : net_type; //DT
|
||||
fd : Socket;
|
||||
fcntl : Longint;
|
||||
buff,buff_end,write_pos : Pchar;
|
||||
buff,buff_end,write_pos,read_pos : Pchar;//DT
|
||||
last_error : array [0..MYSQL_ERRMSG_SIZE-1] of char;
|
||||
last_errno,max_packet,timeout,pkt_nr : Cardinal;
|
||||
error,return_errno : my_bool;
|
||||
compress : my_bool; //DT
|
||||
|
||||
remain_in_buf,r_length, buf_length, where_b : cardinal; //DT
|
||||
more : my_bool;//DT
|
||||
save_char : char; //DT
|
||||
end;
|
||||
TNET = st_net;
|
||||
PNET = ^TNET;
|
||||
@ -184,6 +191,9 @@ procedure scramble(toarg,message,password : pchar; old_ver : my_bool);cdecl;
|
||||
function check_scramble(scramble,message : pchar; salt : cardinal;old_ver:my_bool) : my_bool;cdecl;
|
||||
function get_tty_password(opt_message: pchar) : pchar;cdecl;
|
||||
|
||||
{
|
||||
#define NULL_LENGTH ((unsigned long) ~0) { For net_store_length }
|
||||
}
|
||||
|
||||
implementation
|
||||
|
||||
@ -211,7 +221,10 @@ function get_tty_password(opt_message: pchar) : pchar;cdecl;external;
|
||||
|
||||
end.
|
||||
$Log$
|
||||
Revision 1.2 2000-07-13 11:33:26 michael
|
||||
Revision 1.3 2000-12-02 15:24:37 michael
|
||||
+ Merged changes from fixbranch
|
||||
|
||||
Revision 1.2 2000/07/13 11:33:26 michael
|
||||
+ removed logs
|
||||
|
||||
}
|
||||
|
@ -1,11 +1,16 @@
|
||||
#include <mysql.h>
|
||||
#include <mysql_com.h>
|
||||
#include <stdio.h>
|
||||
|
||||
main ()
|
||||
{
|
||||
my_bool i;
|
||||
NET n;
|
||||
printf ("MYSQL : %d\n",sizeof(MYSQL));
|
||||
enum enum_net_type nettype;
|
||||
struct st_mysql_options options;
|
||||
my_ulonglong llong;
|
||||
|
||||
printf ("MYSQL : %d options : %d\n",sizeof(MYSQL),sizeof(options));
|
||||
printf ("MYSQL_DATA : %d\n",sizeof(MYSQL_DATA));
|
||||
printf ("MYSQL_ROWS : %d\n",sizeof(MYSQL_ROWS));
|
||||
printf ("MYSQL_ROW : %d\n",sizeof(MYSQL_ROW));
|
||||
@ -13,9 +18,10 @@ main ()
|
||||
printf ("MYSQL_RES : %d\n",sizeof(MYSQL_RES));
|
||||
printf ("MEM_ROOT : %d\n",sizeof(MEM_ROOT));
|
||||
printf ("my_bool : %d\n",sizeof(my_bool));
|
||||
printf ("NET : %d\n",sizeof(NET));
|
||||
printf ("NET : %d NET.nettype : %d\n",sizeof(NET),sizeof(nettype));
|
||||
printf ("USED_MEM : %d\n",sizeof(USED_MEM));
|
||||
printf ("new: %d\n",sizeof(char [MYSQL_ERRMSG_SIZE]));
|
||||
printf ("longlong: %d\n",sizeof(llong));
|
||||
i=n.error;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,8 @@ uses mysql,mysql_com;
|
||||
|
||||
|
||||
begin
|
||||
Writeln ('MYSQL : ',sizeof(TMYSQL));
|
||||
Writeln('PASCAL');
|
||||
Writeln ('MYSQL : ',sizeof(TMYSQL),' options : ',sizeof(st_mysql_options));
|
||||
writeln ('MYSQL_DATA : ',sizeof(TMYSQL_DATA));
|
||||
writeln ('MYSQL_ROWS : ',sizeof(TMYSQL_ROWS));
|
||||
writeln ('MYSQL_ROW : ',sizeof(TMYSQL_ROW));
|
||||
@ -12,11 +13,14 @@ begin
|
||||
writeln ('MYSQL_RES : ',sizeof(TMYSQL_RES));
|
||||
writeln ('MEM_ROOT : ',sizeof(TMEM_ROOT));
|
||||
writeln ('my_bool : ',sizeof(my_bool));
|
||||
writeln ('TNET : ',sizeof(TNET));
|
||||
writeln ('TNET : ',sizeof(TNET),' TNET.nettype : ',SizeOf(net_type));
|
||||
writeln ('USED_MEM : ',sizeof(TUSED_MEM));
|
||||
end.
|
||||
$Log$
|
||||
Revision 1.2 2000-07-13 11:33:26 michael
|
||||
Revision 1.3 2000-12-02 15:24:37 michael
|
||||
+ Merged changes from fixbranch
|
||||
|
||||
Revision 1.2 2000/07/13 11:33:26 michael
|
||||
+ removed logs
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user