|
From: <dav...@us...> - 2010-01-03 03:32:24
|
Revision: 886
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=886&view=rev
Author: davidvtaylor
Date: 2010-01-03 03:32:16 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
* Add typecasts to fix string mismatch warnings with ZeosDBO v7. The Zeos team chose to "Ansify" the library rather than perform a full Unicode port. The typecasts have no effect on previous Delphi versions.
Modified Paths:
--------------
trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas
trunk/Source/Brokers/ZeosDBO/InstantZeosDBOCatalog.pas
Modified: trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas
===================================================================
--- trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas 2010-01-03 01:58:02 UTC (rev 885)
+++ trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas 2010-01-03 03:32:16 UTC (rev 886)
@@ -365,7 +365,7 @@
with DbcConnection.GetMetadata.GetCatalogs do
try
while Next do
- Strings.Add(GetString(1));
+ Strings.Add(string(GetString(1)));
finally
Close;
end;
@@ -1124,7 +1124,7 @@
DbcConnection.QueryInterface(IZMySqlConnection, MySqlConnection);
if Assigned(MySqlConnection) then
MySqlConnection.GetPlainDriver.
- CreateDatabase(MySqlConnection.GetConnectionHandle, PAnsiChar(Database))
+ CreateDatabase(MySqlConnection.GetConnectionHandle, PAnsiChar(AnsiString(Database)))
else
inherited;
finally
Modified: trunk/Source/Brokers/ZeosDBO/InstantZeosDBOCatalog.pas
===================================================================
--- trunk/Source/Brokers/ZeosDBO/InstantZeosDBOCatalog.pas 2010-01-03 01:58:02 UTC (rev 885)
+++ trunk/Source/Brokers/ZeosDBO/InstantZeosDBOCatalog.pas 2010-01-03 03:32:16 UTC (rev 886)
@@ -85,13 +85,13 @@
// Work around for a ZeosDBO behavior with Interbase and Firebird, where
// metadata name with wildcards ('_' or '%') receives a '%' after its name,
// and another drivers where metadata names are searched with LIKE clause
- if SameText(Fields.GetStringByName('TABLE_NAME'), TableMetadata.Name) then
+ if SameText(string(Fields.GetStringByName('TABLE_NAME')), TableMetadata.Name) then
begin
if ColumnTypeToDataType(TZSQLType(Fields.GetShortByName('DATA_TYPE')),
FieldDataType, FieldAlternateDataTypes) then
begin
FieldMetadata := TableMetadata.FieldMetadatas.Add;
- FieldMetadata.Name := Fields.GetStringByName('COLUMN_NAME');
+ FieldMetadata.Name := string(Fields.GetStringByName('COLUMN_NAME'));
FieldMetadata.DataType := FieldDataType;
FieldMetadata.AlternateDataTypes := FieldAlternateDataTypes;
FieldMetadata.Options := [];
@@ -131,20 +131,20 @@
while PrimaryKeys.Next do
// Work around for a ZeosDBO behavior with Interbase and Firebird where
// metadata names are searched with LIKE clause
- if SameText(PrimaryKeys.GetStringByName('TABLE_NAME'), TableMetadata.Name) then
+ if SameText(string(PrimaryKeys.GetStringByName('TABLE_NAME')), TableMetadata.Name) then
begin
- IndexName := PrimaryKeys.GetStringByName('PK_NAME');
+ IndexName := string(PrimaryKeys.GetStringByName('PK_NAME'));
// MySQL driver doesn't assign PK_NAME
if IndexName = '' then
IndexName := 'PRIMARY';
if Assigned(IndexMetadata) and SameText(IndexMetadata.Name, IndexName) then
IndexMetadata.Fields := IndexMetadata.Fields + ';' +
- PrimaryKeys.GetStringByName('COLUMN_NAME')
+ string(PrimaryKeys.GetStringByName('COLUMN_NAME'))
else
begin
IndexMetadata := TableMetadata.IndexMetadatas.Add;
IndexMetadata.Name := IndexName;
- IndexMetadata.Fields := PrimaryKeys.GetStringByName('COLUMN_NAME');
+ IndexMetadata.Fields := string(PrimaryKeys.GetStringByName('COLUMN_NAME'));
IndexMetadata.Options := [ixPrimary, ixUnique];
end;
end;
@@ -157,17 +157,17 @@
IndexInfo.BeforeFirst;
while IndexInfo.Next do
begin
- IndexName := IndexInfo.GetStringByName('INDEX_NAME');
+ IndexName := string(IndexInfo.GetStringByName('INDEX_NAME'));
// Exclude primary keys
if not Assigned(TableMetadata.IndexMetadatas.Find(IndexName)) then
begin
if Assigned(IndexMetadata) and SameText(IndexMetadata.Name, IndexName) then
IndexMetadata.Fields := IndexMetadata.Fields + ';' +
- IndexInfo.GetStringByName('COLUMN_NAME');
+ string(IndexInfo.GetStringByName('COLUMN_NAME'));
begin
IndexMetadata := TableMetadata.IndexMetadatas.Add;
IndexMetadata.Name := IndexName;
- IndexMetadata.Fields := IndexInfo.GetStringByName('COLUMN_NAME');
+ IndexMetadata.Fields := string(IndexInfo.GetStringByName('COLUMN_NAME'));
IndexMetadata.Options := [];
if not IndexInfo.GetBooleanByName('NON_UNIQUE')
{ TODO : This work around must be removed for ZeosDBO versions
@@ -199,10 +199,10 @@
Tables.BeforeFirst;
while Tables.Next do
begin
- if SameText(Tables.GetStringByName('TABLE_TYPE'), 'TABLE') then
+ if SameText(string(Tables.GetStringByName('TABLE_TYPE')), 'TABLE') then
begin
TableMetadata := TableMetadatas.Add;
- TableMetadata.Name := Tables.GetStringByName('TABLE_NAME');
+ TableMetadata.Name := string(Tables.GetStringByName('TABLE_NAME'));
// Call AddIndexMetadatas first, so that AddFieldMetadatas can see which
// indexes are defined to correctly set the foIndexed option.
AddIndexMetadatas(TableMetadata);
|