View Issue Details

IDProjectCategoryView StatusLast Update
0033916FPCDatabasepublic2018-06-28 10:21
ReporterOndrej PokornyAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033916: Range Check error in MySQL
DescriptionI get a range check error when I execute this SQL:

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = :tablename ORDER BY ORDINAL_POSITION

The range check error happens in TConnectionName.MySQLDataType when assigning the ASize variable for AField^.Name='GENERATION_EXPRESSION'

because ASize is Integer and AField^.length>High(Integer)
Additional InformationPatch attached.
TagsNo tags attached.
Fixed in Revision39320
FPCOldBugId
FPCTarget
Attached Files
  • mysqlconn-01.patch (535 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)
    @@ -702,7 +702,9 @@
     end;
     
     function TConnectionName.MySQLDataType(AField: PMYSQL_FIELD; var NewType: TFieldType; var NewSize: Integer): Boolean;
    -var ASize, ADecimals: integer;
    +var
    +  ASize: culong;
    +  ADecimals: cuint;
     begin
       Result := True;
       ASize := AField^.length;
    
    mysqlconn-01.patch (535 bytes)

Activities

Ondrej Pokorny

2018-06-27 18:49

developer  

mysqlconn-01.patch (535 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)
@@ -702,7 +702,9 @@
 end;
 
 function TConnectionName.MySQLDataType(AField: PMYSQL_FIELD; var NewType: TFieldType; var NewSize: Integer): Boolean;
-var ASize, ADecimals: integer;
+var
+  ASize: culong;
+  ADecimals: cuint;
 begin
   Result := True;
   ASize := AField^.length;
mysqlconn-01.patch (535 bytes)

Michael Van Canneyt

2018-06-28 10:10

administrator   ~0109094

Applied, thank you!

Ondrej Pokorny

2018-06-28 10:21

developer   ~0109098

Thank you!

Issue History

Date Modified Username Field Change
2018-06-27 18:49 Ondrej Pokorny New Issue
2018-06-27 18:49 Ondrej Pokorny File Added: mysqlconn-01.patch
2018-06-27 21:39 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-06-27 21:39 Michael Van Canneyt Status new => assigned
2018-06-28 10:10 Michael Van Canneyt Fixed in Revision => 39320
2018-06-28 10:10 Michael Van Canneyt Note Added: 0109094
2018-06-28 10:10 Michael Van Canneyt Status assigned => resolved
2018-06-28 10:10 Michael Van Canneyt Fixed in Version => 3.1.1
2018-06-28 10:10 Michael Van Canneyt Resolution open => fixed
2018-06-28 10:10 Michael Van Canneyt Target Version => 3.2.0
2018-06-28 10:21 Ondrej Pokorny Note Added: 0109098
2018-06-28 10:21 Ondrej Pokorny Status resolved => closed