mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 07:26:24 +02:00
* Mysql servers before version 5.0.3 removes trailing spaces on varchar fields, adapted testvalues to take this into account
git-svn-id: trunk@10779 -
This commit is contained in:
parent
2109a8b611
commit
f8e5776b11
@ -94,6 +94,7 @@ implementation
|
|||||||
|
|
||||||
procedure TSQLDBConnector.CreateFConnection;
|
procedure TSQLDBConnector.CreateFConnection;
|
||||||
var i : TSQLDBTypes;
|
var i : TSQLDBTypes;
|
||||||
|
t : integer;
|
||||||
begin
|
begin
|
||||||
for i := low(DBTypesNames) to high(DBTypesNames) do
|
for i := low(DBTypesNames) to high(DBTypesNames) do
|
||||||
if UpperCase(dbconnectorparams) = DBTypesNames[i] then sqldbtype := i;
|
if UpperCase(dbconnectorparams) = DBTypesNames[i] then sqldbtype := i;
|
||||||
@ -102,6 +103,13 @@ begin
|
|||||||
|
|
||||||
if SQLDbType = MYSQL40 then Fconnection := tMySQL40Connection.Create(nil);
|
if SQLDbType = MYSQL40 then Fconnection := tMySQL40Connection.Create(nil);
|
||||||
if SQLDbType = MYSQL41 then Fconnection := tMySQL41Connection.Create(nil);
|
if SQLDbType = MYSQL41 then Fconnection := tMySQL41Connection.Create(nil);
|
||||||
|
if SQLDbType in [mysql40,mysql41] then
|
||||||
|
begin
|
||||||
|
// Mysql versions prior to 5.0.3 removes the trailing spaces on varchar
|
||||||
|
// fields on insertion. So to test properly, we have to do the same
|
||||||
|
for t := 0 to testValuesCount-1 do
|
||||||
|
testStringValues[t] := TrimRight(testStringValues[t]);
|
||||||
|
end;
|
||||||
if SQLDbType = MYSQL50 then Fconnection := tMySQL50Connection.Create(nil);
|
if SQLDbType = MYSQL50 then Fconnection := tMySQL50Connection.Create(nil);
|
||||||
if SQLDbType in MySQLdbTypes then
|
if SQLDbType in MySQLdbTypes then
|
||||||
FieldtypeDefinitions[ftLargeint] := 'BIGINT';
|
FieldtypeDefinitions[ftLargeint] := 'BIGINT';
|
||||||
|
Loading…
Reference in New Issue
Block a user