mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00

1. When user opens a file which is bigger than LOAD_SIZE (currently 5M), ask what to do 2. User can normally open the file, cancel, or use the new mechanism: 3. Load a chunk of LOAD_SIZE of SQL into memory 4. Split chunk with parseSQL into single queries 5. Run queries and go on with 3. parseSQL is the bottleneck here, very CPU consuming, as it has to take care of different comment-styles and delimiters. So, the above strategy effected a good compromise regarding overall performance on different tests with worst case SQL files: - "Wide" table exports with many big sized fields => long lines - "Narrow" table exports with only one mini-sized field, extended INSERTs => short lines Especially in the latter case it avoids to cause a hellfire of parseSQL-calls Still seems to have some memory leaks somewhere.
44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
// Common constants
|
|
const
|
|
|
|
// Carriage return / Line feed
|
|
CRLF = #13#10;
|
|
|
|
// Names of the system tables and system databases
|
|
PRIVTABLE_USERS = 'user';
|
|
PRIVTABLE_DB = 'db';
|
|
PRIVTABLE_TABLES = 'tables_priv';
|
|
PRIVTABLE_COLUMNS = 'columns_priv';
|
|
DBNAME_INFORMATION_SCHEMA = 'information_schema';
|
|
DBNAME_MYSQL = 'mysql';
|
|
LOCAL_HOST = '127.0.0.1';
|
|
MYSQL_PORT = 3306;
|
|
|
|
// Related field things
|
|
TBLTYPE_AUTOMATIC: String = '<Automatic>';
|
|
TEMPFIELDNAME = 'temp_fieldname';
|
|
|
|
// General things
|
|
APPNAME = 'HeidiSQL';
|
|
REGPATH = 'Software\' + APPNAME;
|
|
STATUS_MSG_READY = 'Ready.';
|
|
STR_NOTSUPPORTED = 'Not supported by this server';
|
|
|
|
// Used by maskSQL and fixSQL:
|
|
SQL_VERSION_ANSI = -1;
|
|
|
|
// Used for simulating a TTreeNode which has subnodes
|
|
DUMMY_NODE_TEXT : String = 'Dummy node, should never be visible';
|
|
|
|
// Used for SQL Log display limit (prevents color display errors)
|
|
SQLLOG_CHAR_LIMIT = 2000;
|
|
|
|
// Registry name for storing list of displayed columns
|
|
REGNAME_DISPLAYEDCOLUMNS = 'DisplayedColumns';
|
|
|
|
// how much memory we're aiming to use for the
|
|
// data grid and it's automatic limit function
|
|
// this value should probably be user configurable
|
|
LOAD_SIZE = 5*1024*1024;
|
|
|