Permalink
Browse files

Version 5.2.5.102

  • Loading branch information...
1 parent dafd9dc commit 904ef17daa3da8ac05453f22cd24bf4fdc9fadbc Nils.Hoyer committed Oct 11, 2012
Showing with 25 additions and 44 deletions.
  1. +2 −2 Build_Setup.ini
  2. +7 −1 Source/MySQL/Source/MySQLClient.pas
  3. +4 −0 Source/fDImport.dfm
  4. +12 −41 Source/fDImport.pas
View
4 Build_Setup.ini
@@ -9,8 +9,8 @@ Taskschd=MySQL-Front
Major=5
Minor=2
Patch=5
-Build=101
-Beta=1
+Build=102
+Beta=0
[Internet]
Homepage=http://www.mysqlfront.de/
View
8 Source/MySQL/Source/MySQLClient.pas
@@ -1539,7 +1539,9 @@ function TMySQL_File.ReceivePacket(): Boolean;
Result := Receive(PacketBuffer.Mem[PacketBuffer.Size], BytesToRead, BytesRead);
if (Result) then
- Inc(PacketBuffer.Size, BytesRead);
+ Inc(PacketBuffer.Size, BytesRead)
+ else
+ Seterror(CR_UNKNOWN_ERROR); // Debug
end;
function ReceiveCompressed(const BytesToRead: my_uint; out BytesRead: my_uint): Boolean;
@@ -1589,7 +1591,11 @@ function TMySQL_File.ReceivePacket(): Boolean;
else
begin
if (PacketOffset + UncompressedSize > PacketBuffer.MemSize) then
+ begin
Result := ReallocBuffer(PacketBuffer, PacketOffset + UncompressedSize);
+ if (not Result) then
+ Seterror(CR_UNKNOWN_ERROR); // Debug
+ end;
try
DecompressBuffer.Mem := nil;
View
4 Source/fDImport.dfm
@@ -54,6 +54,10 @@ object DImport: TDImport
TabVisible = False
OnHide = TSTablesHide
OnShow = TSTablesShow
+ ExplicitLeft = 0
+ ExplicitTop = 0
+ ExplicitWidth = 0
+ ExplicitHeight = 0
object GTable: TGroupBox_Ext
Left = 4
Top = 0
View
53 Source/fDImport.pas
@@ -1479,11 +1479,9 @@ procedure TDImport.TSTablesHide(Sender: TObject);
procedure TDImport.TSTablesShow(Sender: TObject);
const
TABLE_TYPE_LEN = 30;
- TABLE_REMARKS_LEN = 1024;
var
cbTABLE_NAME: SQLINTEGER;
cbTABLE_TYPE: SQLINTEGER;
- cbTABLE_REMARKS: SQLINTEGER;
Handle: SQLHSTMT;
I: Integer;
Index: Integer;
@@ -1494,7 +1492,6 @@ procedure TDImport.TSTablesShow(Sender: TObject);
TABLE_NAME: PSQLTCHAR;
TABLE_NAME_LEN: SQLINTEGER;
TABLE_TYPE: PSQLTCHAR;
- TABLE_REMARKS: PSQLTCHAR;
begin
if (FTables.Items.Count = 0) then
begin
@@ -1506,47 +1503,21 @@ procedure TDImport.TSTablesShow(Sender: TObject);
ODBCException(ODBC, SQLGetInfo(ODBC, SQL_MAX_TABLE_NAME_LEN, @TABLE_NAME_LEN, SizeOf(TABLE_NAME_LEN), nil));
GetMem(TABLE_NAME, (TABLE_NAME_LEN + 1) * SizeOf(SQLWCHAR));
GetMem(TABLE_TYPE, (TABLE_TYPE_LEN + 1) * SizeOf(SQLWCHAR));
- GetMem(TABLE_REMARKS, (TABLE_REMARKS_LEN + 1) * SizeOf(SQLWCHAR));
-
-// if (ImportType = itExcelFile) then
-// begin
-// ODBCException(Handle, SQLTables(Handle, nil, 0, nil, 0, nil, 0, nil, SQL_NTS));
-// ODBCException(Handle, SQLBindCol(Handle, 3, SQL_C_WCHAR, TABLE_NAME, (TABLE_NAME_LEN + 1) * SizeOf(SQLWCHAR), @cbTABLE_NAME));
-// ODBCException(Handle, SQLBindCol(Handle, 4, SQL_C_WCHAR, TABLE_TYPE, (TABLE_TYPE_LEN + 1) * SizeOf(SQLWCHAR), @cbTABLE_TYPE));
-// ODBCException(Handle, SQLBindCol(Handle, 5, SQL_C_WCHAR, TABLE_REMARKS, (TABLE_REMARKS_LEN + 1) * SizeOf(SQLWCHAR), @cbTABLE_REMARKS));
-// while (SQL_SUCCEEDED(ODBCException(Handle, SQLFetch(Handle)))) do
-// if (lstrcmpi(PChar(TABLE_TYPE), 'SYSTEM TABLE') = 0) then
-// begin
-// SetString(TableName, PChar(TABLE_NAME), cbTABLE_NAME div SizeOf(SQLTCHAR));
-// if (RightStr(TableName, 1) = '$') then
-// TableNames.Add(LeftStr(TableName, Length(TableName) - 1))
-// else
-// TableNames.Add(TableName);
-// end;
-// SQLFreeStmt(Handle, SQL_CLOSE);
-// end;
-
-// if ((ImportType <> itExcelFile) or (TableNames.Count = 0)) then
- begin
- ODBCException(Handle, SQLTables(Handle, nil, 0, nil, 0, nil, 0, nil, SQL_NTS));
- ODBCException(Handle, SQLBindCol(Handle, 3, SQL_C_WCHAR, TABLE_NAME, (TABLE_NAME_LEN + 1) * SizeOf(SQLWCHAR), @cbTABLE_NAME));
- ODBCException(Handle, SQLBindCol(Handle, 4, SQL_C_WCHAR, TABLE_TYPE, (TABLE_TYPE_LEN + 1) * SizeOf(SQLWCHAR), @cbTABLE_TYPE));
- ODBCException(Handle, SQLBindCol(Handle, 5, SQL_C_WCHAR, TABLE_REMARKS, (TABLE_REMARKS_LEN + 1) * SizeOf(SQLWCHAR), @cbTABLE_REMARKS));
- while (SQL_SUCCEEDED(ODBCException(Handle, SQLFetch(Handle)))) do
-// if (lstrcmpi(PChar(TABLE_TYPE), 'TABLE') = 0) then
- begin
- SetString(TableName, PChar(TABLE_NAME), cbTABLE_NAME div SizeOf(SQLTCHAR));
-// if ((ImportType = itExcelFile) and (RightStr(TableName, 1) = '$')) then
-// TableNames.Add(LeftStr(TableName, Length(TableName) - 1))
-// else
- TableNames.Add(TableName);
- end;
- SQLFreeStmt(Handle, SQL_CLOSE);
- end;
+
+ ODBCException(Handle, SQLTables(Handle, nil, 0, nil, 0, nil, 0, nil, SQL_NTS));
+ ODBCException(Handle, SQLBindCol(Handle, 3, SQL_C_WCHAR, TABLE_NAME, (TABLE_NAME_LEN + 1) * SizeOf(SQLWCHAR), @cbTABLE_NAME));
+ ODBCException(Handle, SQLBindCol(Handle, 4, SQL_C_WCHAR, TABLE_TYPE, (TABLE_TYPE_LEN + 1) * SizeOf(SQLWCHAR), @cbTABLE_TYPE));
+ while (SQL_SUCCEEDED(ODBCException(Handle, SQLFetch(Handle)))) do
+ if ((lstrcmpi(PChar(TABLE_TYPE), 'TABLE') = 0) or (ImportType = itExcelFile) and (lstrcmpi(PChar(TABLE_TYPE), 'SYSTEM TABLE') = 0)) then
+ begin
+ SetString(TableName, PChar(TABLE_NAME), cbTABLE_NAME div SizeOf(SQLTCHAR));
+ if ((ImportType <> itExcelFile) or (Pos('$', TableName) > 0)) then
+ TableNames.Add(TableName);
+ end;
+ SQLFreeStmt(Handle, SQL_CLOSE);
FreeMem(TABLE_NAME);
FreeMem(TABLE_TYPE);
- FreeMem(TABLE_REMARKS);
SQLFreeHandle(SQL_HANDLE_STMT, Handle);
end
else if (ImportType = itSQLiteFile) then

0 comments on commit 904ef17

Please sign in to comment.