View Issue Details

IDProjectCategoryView StatusLast Update
0033922FPCDatabasepublic2018-06-28 09:58
ReporterOndrej PokornyAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033922: MySQL: make EscapeString protected
DescriptionThe attached patch makes EscapeString protected so that it can be used in overriden functions (e.g. GetAsSQLText).
TagsNo tags attached.
Fixed in Revision39318
FPCOldBugId
FPCTarget
Attached Files
  • MySQL-escapestring-protected-01.patch (959 bytes)
    Index: packages/fcl-db/src/sqldb/mysql/mysqlconn.inc
    ===================================================================
    --- packages/fcl-db/src/sqldb/mysql/mysqlconn.inc	(revision 39317)
    +++ packages/fcl-db/src/sqldb/mysql/mysqlconn.inc	(working copy)
    @@ -117,12 +117,12 @@
         function GetServerStatus: String;
         procedure ConnectMySQL(var HMySQL: PMySQL);
         procedure ExecuteDirectMySQL(const query : string);
    -    function EscapeString(const Str : string) : string;
       protected
         Procedure ConnectToServer; virtual;
         Procedure SelectDatabase; virtual;
         function MySQLDataType(AField: PMYSQL_FIELD; var NewType: TFieldType; var NewSize: Integer): Boolean;
         function MySQLWriteData(AField: PMYSQL_FIELD; FieldDef: TFieldDef; Source, Dest: PChar; Len: integer; out CreateBlob : boolean): Boolean;
    +    function EscapeString(const Str : string) : string;
     
         // SQLConnection methods
         procedure DoInternalConnect; override;
    

Activities

Ondrej Pokorny

2018-06-28 09:11

developer  

MySQL-escapestring-protected-01.patch (959 bytes)
Index: packages/fcl-db/src/sqldb/mysql/mysqlconn.inc
===================================================================
--- packages/fcl-db/src/sqldb/mysql/mysqlconn.inc	(revision 39317)
+++ packages/fcl-db/src/sqldb/mysql/mysqlconn.inc	(working copy)
@@ -117,12 +117,12 @@
     function GetServerStatus: String;
     procedure ConnectMySQL(var HMySQL: PMySQL);
     procedure ExecuteDirectMySQL(const query : string);
-    function EscapeString(const Str : string) : string;
   protected
     Procedure ConnectToServer; virtual;
     Procedure SelectDatabase; virtual;
     function MySQLDataType(AField: PMYSQL_FIELD; var NewType: TFieldType; var NewSize: Integer): Boolean;
     function MySQLWriteData(AField: PMYSQL_FIELD; FieldDef: TFieldDef; Source, Dest: PChar; Len: integer; out CreateBlob : boolean): Boolean;
+    function EscapeString(const Str : string) : string;
 
     // SQLConnection methods
     procedure DoInternalConnect; override;

Michael Van Canneyt

2018-06-28 09:54

administrator   ~0109091

Applied, thank you!

Ondrej Pokorny

2018-06-28 09:58

developer   ~0109092

Thank you!

Issue History

Date Modified Username Field Change
2018-06-28 09:11 Ondrej Pokorny New Issue
2018-06-28 09:11 Ondrej Pokorny File Added: MySQL-escapestring-protected-01.patch
2018-06-28 09:26 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-06-28 09:26 Michael Van Canneyt Status new => assigned
2018-06-28 09:54 Michael Van Canneyt Fixed in Revision => 39318
2018-06-28 09:54 Michael Van Canneyt Note Added: 0109091
2018-06-28 09:54 Michael Van Canneyt Status assigned => resolved
2018-06-28 09:54 Michael Van Canneyt Fixed in Version => 3.1.1
2018-06-28 09:54 Michael Van Canneyt Resolution open => fixed
2018-06-28 09:54 Michael Van Canneyt Target Version => 3.2.0
2018-06-28 09:58 Ondrej Pokorny Note Added: 0109092
2018-06-28 09:58 Ondrej Pokorny Status resolved => closed