mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 05:09:49 +02:00
* Patch from Joost van der Sluis
- Made it possible to run 'show' queries for MySQL
This commit is contained in:
parent
d0a651c990
commit
f04a7f8f86
@ -60,6 +60,7 @@ type
|
|||||||
|
|
||||||
procedure SetTransaction(Value : TSQLTransaction);
|
procedure SetTransaction(Value : TSQLTransaction);
|
||||||
protected
|
protected
|
||||||
|
function StrToStatementType(s : string) : TStatementType; virtual;
|
||||||
procedure DoInternalConnect; override;
|
procedure DoInternalConnect; override;
|
||||||
procedure DoInternalDisconnect; override;
|
procedure DoInternalDisconnect; override;
|
||||||
function GetAsSQLText(Field : TField) : string; virtual;
|
function GetAsSQLText(Field : TField) : string; virtual;
|
||||||
@ -219,6 +220,17 @@ uses dbconst;
|
|||||||
|
|
||||||
{ TSQLConnection }
|
{ TSQLConnection }
|
||||||
|
|
||||||
|
function TSQLConnection.StrToStatementType(s : string) : TStatementType;
|
||||||
|
|
||||||
|
var T : TStatementType;
|
||||||
|
|
||||||
|
begin
|
||||||
|
S:=Lowercase(s);
|
||||||
|
For t:=stselect to strollback do
|
||||||
|
if (S=StatementTokens[t]) then
|
||||||
|
Exit(t);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSQLConnection.SetTransaction(Value : TSQLTransaction);
|
procedure TSQLConnection.SetTransaction(Value : TSQLTransaction);
|
||||||
begin
|
begin
|
||||||
if FTransaction = nil then
|
if FTransaction = nil then
|
||||||
@ -655,7 +667,6 @@ Var
|
|||||||
cmt : boolean;
|
cmt : boolean;
|
||||||
P,PE,PP : PChar;
|
P,PE,PP : PChar;
|
||||||
S : string;
|
S : string;
|
||||||
T : TStatementType;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=stNone;
|
Result:=stNone;
|
||||||
@ -691,10 +702,11 @@ begin
|
|||||||
Inc(PE);
|
Inc(PE);
|
||||||
Setlength(S,PE-P);
|
Setlength(S,PE-P);
|
||||||
Move(P^,S[1],(PE-P));
|
Move(P^,S[1],(PE-P));
|
||||||
S:=Lowercase(s);
|
result := (DataBase as TSQLConnection).StrToStatementType(s);
|
||||||
|
{ S:=Lowercase(s);
|
||||||
For t:=stselect to strollback do
|
For t:=stselect to strollback do
|
||||||
if (S=StatementTokens[t]) then
|
if (S=StatementTokens[t]) then
|
||||||
Exit(t);
|
Exit(t);}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSQLQuery.SetReadOnly(AValue : Boolean);
|
procedure TSQLQuery.SetReadOnly(AValue : Boolean);
|
||||||
@ -808,7 +820,11 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 2005-01-12 10:30:33 michael
|
Revision 1.12 2005-01-24 10:52:43 michael
|
||||||
|
* Patch from Joost van der Sluis
|
||||||
|
- Made it possible to run 'show' queries for MySQL
|
||||||
|
|
||||||
|
Revision 1.11 2005/01/12 10:30:33 michael
|
||||||
* Patch from Joost Van der Sluis:
|
* Patch from Joost Van der Sluis:
|
||||||
- implemented TSQLQuery.UpdateIndexDefs
|
- implemented TSQLQuery.UpdateIndexDefs
|
||||||
- implemented TSQLQuery.ReadOnly
|
- implemented TSQLQuery.ReadOnly
|
||||||
|
Loading…
Reference in New Issue
Block a user