Merge 4.1 -> 5.0

BitKeeper/etc/ignore:
  auto-union
BitKeeper/etc/logging_ok:
  auto-union
VC++Files/sql/mysqld.dsp:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
myisam/myisamchk.c:
  Auto merged
myisam/myisamdef.h:
  Auto merged
mysql-test/install_test_db.sh:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/show_check.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
scripts/mysql_install_db.sh:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
mysql-test/t/rpl_error_ignored_table.test:
  Auto merged
sql/ha_berkeley.h:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_innodb.h:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/lex.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/records.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_acl.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
tests/client_test.c:
  Auto merged
This commit is contained in:
unknown 2004-05-07 18:52:06 +02:00
commit e9c1e75b48
2201 changed files with 519910 additions and 8438 deletions

View File

@ -13,6 +13,9 @@
*/.pure
*~
.*.swp
.defs.mk
.depend
.depend.mk
.deps
.gdb_history
.gdbinit
@ -284,6 +287,7 @@ help.h
include/my_config.h
include/my_global.h
include/mysql_version.h
include/readline
include/readline/*.h
include/readline/readline.h
include/widec.h
@ -301,6 +305,7 @@ innobase/ib_config.h
innobase/ib_config.h.in
innobase/stamp-h1
insert_test
install
isam/isamchk
isam/isamlog
isam/pack_isam
@ -324,6 +329,7 @@ libmysqld/client.c
libmysqld/client_settings.h
libmysqld/convert.cc
libmysqld/derror.cc
libmysqld/discover.cc
libmysqld/errmsg.c
libmysqld/examples/completion_hash.cc
libmysqld/examples/completion_hash.h
@ -518,6 +524,126 @@ mysys/test_thr_alarm
mysys/test_thr_lock
mysys/test_vsnprintf
mysys/testhash
ndb/bin/DbAsyncGenerator
ndb/bin/DbCreate
ndb/bin/acid
ndb/bin/async-lmc-bench-l-p10.sh
ndb/bin/async-lmc-bench-l.sh
ndb/bin/async-lmc-bench-p10.sh
ndb/bin/async-lmc-bench.sh
ndb/bin/atrt
ndb/bin/atrt-analyze-result.sh
ndb/bin/atrt-clear-result.sh
ndb/bin/atrt-gather-result.sh
ndb/bin/atrt-setup.sh
ndb/bin/bankCreator
ndb/bin/bankMakeGL
ndb/bin/bankSumAccounts
ndb/bin/bankTimer
ndb/bin/bankTransactionMaker
ndb/bin/bankValidateAllGLs
ndb/bin/basicTransporterTest
ndb/bin/benchronja
ndb/bin/bulk_copy
ndb/bin/copy_tab
ndb/bin/create_all_tabs
ndb/bin/create_index
ndb/bin/create_tab
ndb/bin/delete_all
ndb/bin/desc
ndb/bin/drop_all_tabs
ndb/bin/drop_index
ndb/bin/drop_tab
ndb/bin/flexAsynch
ndb/bin/flexBench
ndb/bin/flexHammer
ndb/bin/flexScan
ndb/bin/flexTT
ndb/bin/hugoCalculator
ndb/bin/hugoFill
ndb/bin/hugoLoad
ndb/bin/hugoLockRecords
ndb/bin/hugoPkDelete
ndb/bin/hugoPkRead
ndb/bin/hugoPkReadRecord
ndb/bin/hugoPkUpdate
ndb/bin/hugoScanRead
ndb/bin/hugoScanUpdate
ndb/bin/index
ndb/bin/index2
ndb/bin/initronja
ndb/bin/interpreterInTup
ndb/bin/list_tables
ndb/bin/make-config.sh
ndb/bin/mgmtclient
ndb/bin/mgmtsrvr
ndb/bin/mkconfig
ndb/bin/ndb
ndb/bin/ndb_cpcc
ndb/bin/ndb_cpcd
ndb/bin/ndb_rep
ndb/bin/ndbsql
ndb/bin/newton_basic
ndb/bin/newton_br
ndb/bin/newton_pb
ndb/bin/newton_perf
ndb/bin/perfTransporterTest
ndb/bin/printConfig
ndb/bin/printSchemafile
ndb/bin/printSysfile
ndb/bin/redoLogFileReader
ndb/bin/restart
ndb/bin/restarter
ndb/bin/restarter2
ndb/bin/restarts
ndb/bin/restore
ndb/bin/select_all
ndb/bin/select_count
ndb/bin/telco
ndb/bin/testBackup
ndb/bin/testBank
ndb/bin/testBasic
ndb/bin/testBasicAsynch
ndb/bin/testCopy
ndb/bin/testDataBuffers
ndb/bin/testDict
ndb/bin/testGrep
ndb/bin/testGrepVerify
ndb/bin/testIndex
ndb/bin/testInterpreter
ndb/bin/testKernelDataBuffer
ndb/bin/testLongSig
ndb/bin/testMgm
ndb/bin/testMgmapi
ndb/bin/testNdbApi
ndb/bin/testNodeRestart
ndb/bin/testOIBasic
ndb/bin/testOdbcDriver
ndb/bin/testOperations
ndb/bin/testRestartGci
ndb/bin/testScan
ndb/bin/testScanInterpreter
ndb/bin/testSimplePropertiesSection
ndb/bin/testSystemRestart
ndb/bin/testTimeout
ndb/bin/testTransactions
ndb/bin/test_cpcd
ndb/bin/test_event
ndb/bin/verify_index
ndb/bin/waiter
ndb/examples/ndbapi_example1/ndbapi_example1
ndb/examples/ndbapi_example2/ndbapi_example2
ndb/examples/ndbapi_example3/ndbapi_example3
ndb/examples/ndbapi_example5/ndbapi_example5
ndb/examples/select_all/select_all
ndb/lib/libMGM_API.so
ndb/lib/libNDB_API.so
ndb/lib/libNDB_ODBC.so
ndb/lib/libNEWTON_API.so
ndb/lib/libNEWTON_BASICTEST_COMMON.so
ndb/lib/libREP_API.so
ndb/lib/libndbclient.so
ndb/lib/libndbclient_extra.so
pull.log
regex/re
repl-tests/test-repl-ts/repl-timestamp.master.reject

View File

@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster"
. "$path/FINISH.sh"

View File

@ -9,6 +9,6 @@ extra_configs="$pentium_configs"
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \
--with-openssl --with-vio --with-raid"
--with-openssl --with-vio --with-raid --with-ndbcluster"
. "$path/FINISH.sh"

View File

@ -10,6 +10,7 @@ acurtis@pcgem.rdg.cyberkinetica.com
administrador@light.hegel.local
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com
antony@ltantony.dsl-verizon.net
antony@ltantony.rdg.cyberkinetica.homeunix.net
arjen@bitbike.com
arjen@co3064164-a.bitbike.com
@ -24,12 +25,14 @@ bell@laptop.sanja.is.com.ua
bell@sanja.is.com.ua
bk@admin.bk
bk@mysql.r18.ru
brian@brian-akers-computer.local
carsten@tsort.bitbybit.dk
davida@isil.mysql.com
dlenev@brandersnatch.localdomain
dlenev@build.mysql.com
dlenev@jabberwock.localdomain
dlenev@mysql.com
ejonore@mc03.ndb.mysql.com
gerberb@ou800.zenez.com
gluh@gluh.(none)
gluh@gluh.mysql.r18.ru
@ -71,12 +74,14 @@ jcole@mugatu.jcole.us
jcole@mugatu.spaceapes.com
jcole@sarvik.tfr.cafe.ee
jcole@tetra.spaceapes.com
joreland@mysql.com
jorge@linux.jorge.mysql.com
kaj@work.mysql.com
konstantin@mysql.com
kostja@oak.local
lenz@kallisto.mysql.com
lenz@mysql.com
magnus@neptunus.(none)
marko@hundin.mysql.fi
miguel@hegel.(none)
miguel@hegel.br
@ -91,6 +96,7 @@ monty@donna.mysql.fi
monty@hundin.mysql.fi
monty@mashka.(none)
monty@mashka.mysql.fi
monty@mishka.local
monty@mishka.mysql.fi
monty@mysql.com
monty@narttu.
@ -112,6 +118,7 @@ papa@gbichot.local
paul@central.snake.net
paul@ice.local
paul@ice.snake.net
paul@kite-hub.kitebird.com
paul@teton.kitebird.com
pem@mysql.com
pem@per-erik-martins-dator.local
@ -150,10 +157,12 @@ tfr@sarvik.tfr.cafe.ee
tim@bitch.mysql.fi
tim@black.box
tim@hundin.mysql.fi
tim@sand.box
tim@threads.polyesthetic.msg
tim@white.box
tim@work.mysql.com
tom@basil-firewall.home.com
tomas@mc05.(none)
tonu@hundin.mysql.fi
tonu@volk.internalnet
tonu@x153.internalnet

View File

@ -10,7 +10,7 @@ use Sys::Hostname;
$opt_distribution=$opt_user=$opt_config_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix="";
$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=0;
GetOptions(
@ -50,6 +50,7 @@ GetOptions(
"use-old-distribution",
"user=s",
"version-suffix=s",
"with-cluster",
"with-debug",
"with-low-memory",
"with-other-libc=s",
@ -236,6 +237,7 @@ if ($opt_stage <= 1)
$opt_config_options.= " --with-raid" if ($opt_raid);
$opt_config_options.= " --with-readline" if ($opt_readline);
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
# Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB)
@ -289,7 +291,8 @@ if ($opt_stage <= 3)
log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat");
}
$flags.= "--no-strip" if ($opt_no_strip || $opt_with_debug);
$flags.= " --no-strip" if ($opt_no_strip || $opt_with_debug);
$flags.= " --with-ndbcluster" if ($opt__with_ndbcluster);
check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
safe_system("mv mysql*.t*gz $pwd/$host");
if (-f "client/.libs/mysqladmin")
@ -547,6 +550,9 @@ If user is empty then no mail is sent.
--version-suffix=suffix
Set name suffix (e.g. 'com' or '-max') for a distribution
--with cluster
Compile with NDB Cluster
--with-debug
Build binaries with debug information (implies "--no-strip")

View File

@ -142,11 +142,11 @@ character-set=latin1
#define ER_MULTIPLE_PRI_KEY 1068
"Multiple primary key defined",
#define ER_TOO_MANY_KEYS 1069
"Too many keys specified. Max %d keys allowed",
"Too many keys specified; max %d keys allowed",
#define ER_TOO_MANY_KEY_PARTS 1070
"Too many key parts specified. Max %d parts allowed",
#define ER_TOO_LONG_KEY 1071
"Specified key was too long. Max key length is %d",
"Specified key was too long; max key length is %d bytes",
#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072
"Key column '%-.64s' doesn't exist in table",
#define ER_BLOB_USED_AS_KEY 1073
@ -406,7 +406,7 @@ character-set=latin1
#define ER_BAD_SLAVE 1200
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
#define ER_MASTER_INFO 1201
"Could not initialize master info structure, check permisions on master.info",
"Could not initialize master info structure, more error messages can be found in the MySQL error log",
#define ER_SLAVE_THREAD 1202
"Could not create slave thread, check system resources",
#define ER_TOO_MANY_USER_CONNECTIONS 1203
@ -460,7 +460,7 @@ character-set=latin1
#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227
"Access denied. You need the %-.128s privilege for this operation",
#define ER_LOCAL_VARIABLE 1228
"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL",
#define ER_GLOBAL_VARIABLE 1229
"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
#define ER_NO_DEFAULT 1230
@ -479,95 +479,119 @@ character-set=latin1
"Got fatal error %d: '%-.128s' from master when reading data from binary log",
#define ER_SLAVE_IGNORED_TABLE 1237
"Slave SQL thread ignored the query because of replicate-*-table rules",
#define ER_WRONG_FK_DEF 1238
#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238
"Variable '%-.64s' is a %s variable",
#define ER_WRONG_FK_DEF 1239
"Wrong foreign key definition for '%-.64s': %s",
#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1239
#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240
"Key reference and table reference doesn't match",
#define ER_OPERAND_COLUMNS 1240
#define ER_OPERAND_COLUMNS 1241
"Operand should contain %d column(s)",
#define ER_SUBQUERY_NO_1_ROW 1241
#define ER_SUBQUERY_NO_1_ROW 1242
"Subquery returns more than 1 row",
#define ER_UNKNOWN_STMT_HANDLER 1242
#define ER_UNKNOWN_STMT_HANDLER 1243
"Unknown prepared statement handler (%ld) given to %s",
#define ER_CORRUPT_HELP_DB 1243
#define ER_CORRUPT_HELP_DB 1244
"Help database is corrupt or does not exist",
#define ER_CYCLIC_REFERENCE 1244
#define ER_CYCLIC_REFERENCE 1245
"Cyclic reference on subqueries",
#define ER_AUTO_CONVERT 1245
#define ER_AUTO_CONVERT 1246
"Converting column '%s' from %s to %s",
#define ER_ILLEGAL_REFERENCE 1246
#define ER_ILLEGAL_REFERENCE 1247
"Reference '%-.64s' not supported (%s)",
#define ER_DERIVED_MUST_HAVE_ALIAS 1247
#define ER_DERIVED_MUST_HAVE_ALIAS 1248
"Every derived table must have it's own alias",
#define ER_SELECT_REDUCED 1248
#define ER_SELECT_REDUCED 1249
"Select %u was reduced during optimisation",
#define ER_TABLENAME_NOT_ALLOWED_HERE 1249
#define ER_TABLENAME_NOT_ALLOWED_HERE 1250
"Table '%-.64s' from one of SELECT's can not be used in %-.32s",
#define ER_NOT_SUPPORTED_AUTH_MODE 1250
#define ER_NOT_SUPPORTED_AUTH_MODE 1251
"Client does not support authentication protocol requested by server; consider upgrading MySQL client",
#define ER_SPATIAL_CANT_HAVE_NULL 1251
#define ER_SPATIAL_CANT_HAVE_NULL 1252
"All parts of a SPATIAL KEY must be NOT NULL",
#define ER_COLLATION_CHARSET_MISMATCH 1252
#define ER_COLLATION_CHARSET_MISMATCH 1253
"COLLATION '%s' is not valid for CHARACTER SET '%s'",
#define ER_SLAVE_WAS_RUNNING 1253
#define ER_SLAVE_WAS_RUNNING 1254
"Slave is already running",
#define ER_SLAVE_WAS_NOT_RUNNING 1254
#define ER_SLAVE_WAS_NOT_RUNNING 1255
"Slave has already been stopped",
#define ER_TOO_BIG_FOR_UNCOMPRESS 1255
#define ER_TOO_BIG_FOR_UNCOMPRESS 1256
"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)",
#define ER_ZLIB_Z_MEM_ERROR 1256
"ZLIB: Not enough memory available for zlib",
#define ER_ZLIB_Z_BUF_ERROR 1257
"ZLIB: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)",
#define ER_ZLIB_Z_DATA_ERROR 1258
"ZLIB: Input data was corrupted for zlib",
#define ER_CUT_VALUE_GROUP_CONCAT 1259
#define ER_ZLIB_Z_MEM_ERROR 1257
"ZLIB: Not enough memory",
#define ER_ZLIB_Z_BUF_ERROR 1258
"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)",
#define ER_ZLIB_Z_DATA_ERROR 1259
"ZLIB: Input data corrupted",
#define ER_CUT_VALUE_GROUP_CONCAT 1260
"%d line(s) was(were) cut by group_concat()",
#define ER_WARN_TOO_FEW_RECORDS 1260
"Record count is fewer than the column count at row %ld";
#define ER_WARN_TOO_MANY_RECORDS 1261
"Record count is more than the column count at row %ld";
#define ER_WARN_NULL_TO_NOTNULL 1262
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld";
#define ER_WARN_DATA_OUT_OF_RANGE 1263
"Data truncated, out of range for column '%s' at row %ld";
#define ER_WARN_DATA_TRUNCATED 1264
#define ER_WARN_TOO_FEW_RECORDS 1261
"Row %ld doesn't contain data for all columns",
#define ER_WARN_TOO_MANY_RECORDS 1262
"Row %ld was truncated; It contained more data than there were input columns",
#define ER_WARN_NULL_TO_NOTNULL 1263
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
#define ER_WARN_DATA_OUT_OF_RANGE 1264
"Data truncated, out of range for column '%s' at row %ld",
#define ER_WARN_DATA_TRUNCATED 1265
"Data truncated for column '%s' at row %ld",
#define ER_WARN_USING_OTHER_HANDLER 1265
#define ER_WARN_USING_OTHER_HANDLER 1266
"Using storage engine %s for table '%s'",
#define ER_CANT_AGGREGATE_2COLLATIONS 1266
#define ER_CANT_AGGREGATE_2COLLATIONS 1267
"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'",
#define ER_DROP_USER 1267
#define ER_DROP_USER 1268
"Can't drop one or more of the requested users",
#define ER_REVOKE_GRANTS 1268
#define ER_REVOKE_GRANTS 1269
"Can't revoke all privileges, grant for one or more of the requested users",
#define ER_CANT_AGGREGATE_3COLLATIONS 1269
#define ER_CANT_AGGREGATE_3COLLATIONS 1270
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
#define ER_CANT_AGGREGATE_NCOLLATIONS 1270
#define ER_CANT_AGGREGATE_NCOLLATIONS 1271
"Illegal mix of collations for operation '%s'",
#define ER_VARIABLE_IS_NOT_STRUCT 1271
#define ER_VARIABLE_IS_NOT_STRUCT 1272
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
#define ER_UNKNOWN_COLLATION 1272
#define ER_UNKNOWN_COLLATION 1273
"Unknown collation: '%-.64s'",
#define ER_SLAVE_IGNORED_SSL_PARAMS 1273
"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support. They can be used later when MySQL slave with SSL will be started.",
#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1274
"Server is running in --secure-auth mode, but '%s@%s' has a password in the old format; please change the password to the new format",
#define ER_WARN_FIELD_RESOLVED 1275
#define ER_SLAVE_IGNORED_SSL_PARAMS 1274
"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started",
#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275
"Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format",
#define ER_WARN_FIELD_RESOLVED 1276
"Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d",
#define ER_BAD_SLAVE_UNTIL_COND 1276
#define ER_BAD_SLAVE_UNTIL_COND 1277
"Wrong parameter or combination of parameters for START SLAVE UNTIL",
#define ER_MISSING_SKIP_SLAVE 1277
#define ER_MISSING_SKIP_SLAVE 1278
"It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL. Otherwise you will get problems if you get an unexpected slave's mysqld restart",
#define ER_UNTIL_COND_IGNORED 1278
#define ER_UNTIL_COND_IGNORED 1279
"SQL thread is not to be started so UNTIL options are ignored",
#define ER_WRONG_NAME_FOR_INDEX 1279
#define ER_WRONG_NAME_FOR_INDEX 1280
"Incorrect index name '%-.100s'",
#define ER_WRONG_NAME_FOR_CATALOG 1280
#define ER_WRONG_NAME_FOR_CATALOG 1281
"Incorrect catalog name '%-.100s'",
#define ER_WARN_QC_RESIZE 1281
#define ER_WARN_QC_RESIZE 1282
"Query cache failed to set size %lu, new query cache size is %lu",
#define ER_BAD_FT_COLUMN 1282
#define ER_BAD_FT_COLUMN 1283
"Column '%-.64s' cannot be part of FULLTEXT index",
#define ER_UNKNOWN_KEY_CACHE 1283
#define ER_UNKNOWN_KEY_CACHE 1284
"Unknown key cache '%-.100s'",
#define ER_WARN_HOSTNAME_WONT_WORK 1285
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
#define ER_UNKNOWN_STORAGE_ENGINE 1286
"Unknown table engine '%s'",
#define ER_WARN_DEPRECATED_SYNTAX 1287
"'%s' is deprecated, use '%s' instead",
#define ER_NON_UPDATABLE_TABLE 1288
"The target table %-.100s of the %s is not updatable",
#define ER_FEATURE_DISABLED 1289
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
#define ER_OPTION_PREVENTS_STATEMENT 1290
"The MySQL server is running with the %s option so it cannot execute this statement",
#define ER_DUPLICATED_VALUE_IN_TYPE 1291
"Column '%-.100s' has duplicated value '%-.64s' in %s"
#define ER_TRUNCATED_WRONG_VALUE 1292
"Truncated wrong %-.32s value: '%-.128s'"
#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293
"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause"
#define ER_INVALID_ON_UPDATE 1294
"Invalid ON UPDATE clause for '%-.64s' field",
#define ER_UNSUPPORTED_PS 1295
"This command is not supported in the prepared statement protocol yet",

File diff suppressed because it is too large Load Diff

View File

@ -160,6 +160,10 @@ SOURCE="..\strings\ctype-tis620.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-uca.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-ucs2.c"
# End Source File
# Begin Source File

View File

@ -179,6 +179,10 @@ SOURCE="..\strings\ctype-tis620.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-uca.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-ucs2.c"
# End Source File
# Begin Source File

View File

@ -1,152 +0,0 @@
LIBRARY LIBMYSQLD
DESCRIPTION 'MySQL 4.1 Embedded Server Library'
VERSION 4.1
EXPORTS
_dig_vec
bmove_upp
delete_dynamic
free_defaults
getopt_compare_strings
getopt_ull_limit_value
handle_options
init_dynamic_array
insert_dynamic
int2str
is_prefix
list_add
list_delete
load_defaults
max_allowed_packet
my_end
my_getopt_print_errors
my_init
my_malloc
my_memdup
my_no_flags_free
my_path
my_print_help
my_print_variables
my_realloc
my_strdup
my_thread_end
my_thread_init
myodbc_remove_escape
mysql_affected_rows
mysql_autocommit
mysql_change_user
mysql_character_set_name
mysql_close
mysql_commit
mysql_data_seek
mysql_debug
mysql_dump_debug_info
mysql_eof
mysql_errno
mysql_error
mysql_escape_string
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
mysql_fetch_lengths
mysql_fetch_row
mysql_field_count
mysql_field_seek
mysql_field_tell
mysql_free_result
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_info
mysql_init
mysql_insert_id
mysql_kill
mysql_list_dbs
mysql_list_fields
mysql_list_processes
mysql_list_tables
mysql_more_results
mysql_next_result
mysql_num_fields
mysql_num_rows
mysql_odbc_escape_string
mysql_options
mysql_ping
mysql_query
mysql_read_query_result
mysql_real_connect
mysql_real_escape_string
mysql_real_query
mysql_refresh
mysql_rollback
mysql_row_seek
mysql_row_tell
mysql_select_db
mysql_send_query
mysql_shutdown
mysql_ssl_set
mysql_stat
mysql_store_result
mysql_sqlstate
mysql_thread_id
mysql_thread_safe
mysql_use_result
mysql_warning_count
mysql_prepare
mysql_execute
mysql_param_count
mysql_bind_param
mysql_bind_result
mysql_fetch
mysql_fetch_column
mysql_send_long_data
mysql_get_metadata
mysql_param_result
mysql_stmt_close
mysql_stmt_reset
mysql_stmt_free_result
mysql_stmt_errno
mysql_stmt_error
mysql_stmt_sqlstate
mysql_stmt_affected_rows
mysql_stmt_store_result
mysql_stmt_row_seek
mysql_stmt_row_tell
mysql_stmt_data_seek
mysql_stmt_num_rows
net_buffer_length
set_dynamic
strcend
strcont
strdup_root
strfill
strinstr
strmake
strmov
strxmov
mysql_server_end
mysql_server_init
get_tty_password
sql_protocol_typelib
mysql_get_server_version
mysql_sqlstate
charsets_dir
disabled_my_option
my_charset_latin1
init_alloc_root
my_progname
get_charset_by_csname
print_defaults
find_type
strxnmov
strend
my_fopen
my_fclose
unpack_filename
str2int
int10_to_str
longlong10_to_str
my_snprintf_8bit
alloc_root
free_root
my_read

View File

@ -50,7 +50,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisam_ftdump.exe"
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/myisam_ftdump.exe"
!ELSEIF "$(CFG)" == "myisam_ftdump - Win32 Debug"
@ -75,7 +75,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisam_ftdump.exe" /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_debug\zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisam_ftdump.exe" /pdbtype:sept
!ENDIF

View File

@ -218,6 +218,10 @@ SOURCE=.\derror.cpp
# End Source File
# Begin Source File
SOURCE=.\discover.cpp
# End Source File
# Begin Source File
SOURCE=..\libmysql\errmsg.c
# End Source File
# Begin Source File

View File

@ -151,6 +151,10 @@ SOURCE=".\ctype-sjis.c"
SOURCE=".\ctype-tis620.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-uca.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-ucs2.c"
# End Source File

View File

@ -112,6 +112,9 @@
/* Define if we are using OSF1 DEC threads on 3.2 */
#undef HAVE_DEC_3_2_THREADS
/* Builds Example DB */
#undef HAVE_EXAMPLE_DB
/* fp_except from ieeefp.h */
#undef HAVE_FP_EXCEPT
@ -149,6 +152,9 @@
/* Do we use user level threads */
#undef HAVE_mit_thread
/* Using Ndb Cluster DB */
#undef HAVE_NDBCLUSTER_DB
/* For some non posix threads */
#undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC

View File

@ -1302,6 +1302,78 @@ dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_INNODB SECTION
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_EXAMPLEDB
dnl Sets HAVE_EXAMPLE_DB if --with-example-storage-engine is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_EXAMPLEDB], [
AC_ARG_WITH([example-storage-engine],
[
--with-example-storage-engine
Enable the Example Storge Engine],
[exampledb="$withval"],
[exampledb=no])
AC_MSG_CHECKING([for example storage engine])
case "$exampledb" in
yes )
AC_DEFINE(HAVE_EXAMPLE_DB)
AC_MSG_RESULT([yes])
[exampledb=yes]
;;
* )
AC_MSG_RESULT([no])
[exampledb=no]
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_EXAMPLE SECTION
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_NDBCLUSTER
dnl Sets HAVE_NDBCLUSTER_DB if --with-ndbcluster is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
AC_ARG_WITH([ndbcluster],
[
--with-ndbcluster Include the NDB Cluster table handler],
[ndbcluster="$withval"],
[ndbcluster=no])
AC_MSG_CHECKING([for NDB Cluster])
have_ndbcluster=no
ndbcluster_includes=
ndbcluster_libs=
case "$ndbcluster" in
yes )
AC_MSG_RESULT([Using NDB Cluster])
AC_DEFINE(HAVE_NDBCLUSTER_DB)
have_ndbcluster="yes"
ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi"
ndbcluster_libs="\$(top_builddir)/ndb/lib/libNDB_API.a"
ndbcluster_system_libs=""
;;
* )
AC_MSG_RESULT([Not using NDB Cluster])
;;
esac
AC_SUBST(ndbcluster_includes)
AC_SUBST(ndbcluster_libs)
AC_SUBST(ndbcluster_system_libs)
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION
dnl ---------------------------------------------------------------------------
>>>>>>>
dnl By default, many hosts won't let programs access large files;
dnl one must use special compiler options to get large-file access to work.
dnl For more details about this brain damage please see:

View File

@ -43,5 +43,5 @@ enum options_client
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS
};

View File

@ -576,7 +576,8 @@ static void print_result()
else if (!status && changed)
{
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
found_error=1;
if (strcmp(row[2],"note"))
found_error=1;
}
else
printf("%-9s: %s", row[2], row[3]);

View File

@ -37,7 +37,7 @@
** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov
*/
#define DUMP_VERSION "10.6"
#define DUMP_VERSION "10.7"
#include <my_global.h>
#include <my_sys.h>
@ -91,7 +91,6 @@ static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
*opt_compatible_mode_str= 0,
*err_ptr= 0;
static char compatible_mode_normal_str[255];
static char *default_charset= (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET;
static ulong opt_compatible_mode= 0;
static uint opt_mysql_port= 0, err_len= 0;
static my_string opt_mysql_unix_port=0;
@ -104,7 +103,9 @@ FILE *md_result_file;
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol= 0;
static char *default_charset= (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET;
static CHARSET_INFO *charset_info= &my_charset_latin1;
const char *default_dbug_option="d:t:o,/tmp/mysqldump.trace";
const char *compatible_mode_names[]=
{
@ -132,9 +133,6 @@ static struct my_option my_long_options[] =
"Dump all the databases. This will be same as --databases with all databases selected.",
(gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"all", 'a', "Include all MySQL specific create options.",
(gptr*) &create_options, (gptr*) &create_options, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"add-drop-table", OPT_DROP, "Add a 'drop table' before each create.",
(gptr*) &opt_drop, (gptr*) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0},
@ -148,7 +146,7 @@ static struct my_option my_long_options[] =
"Directory where character sets are.", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compatible", OPT_COMPATIBLE,
"Change the dump to be compatible with a given mode. By default tables are dumped without any restrictions. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option does a no operation on earlier server versions.",
"Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.",
(gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compact", OPT_COMPACT,
@ -160,12 +158,21 @@ static struct my_option my_long_options[] =
{"compress", 'C', "Use compression in server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"create-options", OPT_CREATE_OPTIONS,
"Include all MySQL specific create options.",
(gptr*) &create_options, (gptr*) &create_options, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"databases", 'B',
"To dump several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames. 'USE db_name;' will be included in the output.",
(gptr*) &opt_databases, (gptr*) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
{"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (gptr*) &default_charset,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -244,7 +251,7 @@ static struct my_option my_long_options[] =
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"opt", OPT_OPTIMIZE,
"Same as --add-drop-table --add-locks --all --quick --extended-insert --lock-tables --disable-keys. Enabled by default, disable with --skip-opt.",
"Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
@ -272,7 +279,7 @@ static struct my_option my_long_options[] =
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"skip-opt", OPT_SKIP_OPTIMIZATION,
"Disable --opt. Disables --add-locks, --all, --quick, --extended-insert, --lock-tables and --disable-keys.",
"Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
@ -463,7 +470,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_disable_keys=0;
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
#include <sslopt-case.h>
case 'V': print_version(); exit(0);
@ -483,7 +490,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case (int) OPT_SKIP_OPTIMIZATION:
extended_insert= opt_drop= opt_lock= quick= create_options=
opt_disable_keys= lock_tables= 0;
opt_disable_keys= lock_tables= opt_set_charset= 0;
break;
case (int) OPT_COMPACT:
if (opt_compact)
@ -655,8 +662,7 @@ static int dbConnect(char *host, char *user,char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (opt_set_charset)
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock= mysql_real_connect(&mysql_connection,host,user,passwd,
NULL,opt_mysql_port,opt_mysql_unix_port,
0)))
@ -859,11 +865,11 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
{
if ((*row)[i])
{
fputs(" ", xml_file);
fputc(' ', xml_file);
print_quoted_xml(xml_file, field->name, field->name_length);
fputs("=\"", xml_file);
print_quoted_xml(xml_file, (*row)[i], lengths[i]);
fputs("\"", xml_file);
fputc('"', xml_file);
}
}
fputs(" />\n", xml_file);
@ -897,6 +903,9 @@ static uint getTableStructure(char *table, char* db)
sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
(opt_quoted || opt_keywords));
if (!create_options)
strmov(strend(insert_pat), "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */");
result_table= quote_name(table, table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
if (!opt_xml && !mysql_query(sock,insert_pat))
@ -978,8 +987,10 @@ static uint getTableStructure(char *table, char* db)
}
else
{
/* fprintf(stderr, "%s: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n",
my_progname, mysql_error(sock)); */
if (verbose)
fprintf(stderr,
"%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n",
my_progname, mysql_error(sock));
sprintf(insert_pat,"show fields from %s", result_table);
if (mysql_query(sock,insert_pat) || !(tableRes=mysql_store_result(sock)))
@ -1172,7 +1183,7 @@ static uint getTableStructure(char *table, char* db)
else
{
fputs("/*!",sql_file);
print_value(sql_file,tableRes,row,"type=","Type",0);
print_value(sql_file,tableRes,row,"engine=","Engine",0);
print_value(sql_file,tableRes,row,"","Create_options",0);
print_value(sql_file,tableRes,row,"comment=","Comment",1);
fputs(" */",sql_file);
@ -1413,12 +1424,12 @@ static void dumpTable(uint numFields, char *table)
fputs("Aborting dump (out of memory)",stderr);
safe_exit(EX_EOM);
}
dynstr_append(&extended_row,"\'");
dynstr_append(&extended_row,"'");
extended_row.length +=
mysql_real_escape_string(&mysql_connection,
&extended_row.str[extended_row.length],row[i],length);
extended_row.str[extended_row.length]='\0';
dynstr_append(&extended_row,"\'");
dynstr_append(&extended_row,"'");
}
else
{
@ -1432,9 +1443,9 @@ static void dumpTable(uint numFields, char *table)
if (field->type == FIELD_TYPE_DECIMAL)
{
/* add " signs around */
dynstr_append(&extended_row, "\"");
dynstr_append(&extended_row, "'");
dynstr_append(&extended_row, ptr);
dynstr_append(&extended_row, "\"");
dynstr_append(&extended_row, "'");
}
else
dynstr_append(&extended_row, ptr);
@ -1442,7 +1453,7 @@ static void dumpTable(uint numFields, char *table)
}
}
else
dynstr_append(&extended_row,"\'\'");
dynstr_append(&extended_row,"''");
}
else if (dynstr_append(&extended_row,"NULL"))
{
@ -1486,9 +1497,9 @@ static void dumpTable(uint numFields, char *table)
else if (field->type == FIELD_TYPE_DECIMAL)
{
/* add " signs around */
fputs("\"", md_result_file);
fputc('\'', md_result_file);
fputs(ptr, md_result_file);
fputs("\"", md_result_file);
fputc('\'', md_result_file);
}
else
fputs(ptr, md_result_file);

View File

@ -1853,7 +1853,8 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
# isinf() could be a function or a macro (HPUX)
AC_MSG_CHECKING(for isinf with <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)],
AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ISINF,,[isinf() macro or function]),
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ISINF,,[isinf() macro or function]),
AC_MSG_RESULT(no))
CFLAGS="$ORG_CFLAGS"
@ -2230,7 +2231,6 @@ if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
# For NetWare, do not need readline
echo "Skipping readline"
else
mkdir include/readline
if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
then
@ -2238,7 +2238,7 @@ then
readline_basedir="libedit"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/libedit/liblibedit.a"
readline_h_ln_cmd="\$(LN) \$(top_builddir)/cmd-line-utils/libedit/readline/*.h readline/"
readline_h_ln_cmd="\$(LN) -s \$(top_builddir)/cmd-line-utils/libedit/readline readline"
compile_libedit=yes
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE)
elif test "$with_readline" = "yes"
@ -2247,7 +2247,7 @@ then
readline_basedir="readline"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) \$(top_builddir)/cmd-line-utils/readline/*.h readline/"
readline_h_ln_cmd="\$(LN) -s \$(top_builddir)/cmd-line-utils/readline readline"
compile_readline=yes
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE)
else
@ -2620,6 +2620,8 @@ AC_DEFINE_UNQUOTED(MYSQL_DEFAULT_COLLATION_NAME,"$default_collation")
MYSQL_CHECK_ISAM
MYSQL_CHECK_BDB
MYSQL_CHECK_INNODB
MYSQL_CHECK_EXAMPLEDB
MYSQL_CHECK_NDBCLUSTER
# If we have threads generate some library functions and test programs
sql_server_dirs=
@ -2749,6 +2751,20 @@ EOF
sql_server_dirs="$sql_server_dirs innobase"
AC_CONFIG_SUBDIRS(innobase)
fi
if test X"$have_ndbcluster" = Xyes
then
sql_server_dirs="$sql_server_dirs ndb"
echo "CONFIGURING FOR NDB CLUSTER"
case $with_debug in
no) flag="-R" ;;
*) flag="-D" ;;
esac
flag="$flag --VERSION=$VERSION --PACKAGE=$PACKAGE"
(cd ndb && ./configure $flag) \
|| AC_MSG_ERROR([could not configure NDB Cluster])
echo "END OF NDB CLUSTER CONFIGURATION"
fi
#
# END of configuration for optional table handlers
#
@ -2810,6 +2826,10 @@ case $SYSTEM_TYPE in
MAKE_BINARY_DISTRIBUTION_OPTIONS=
;;
esac
if test X"$have_ndbcluster" = Xyes
then
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
fi
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
# Output results

View File

@ -49,7 +49,7 @@ static struct my_option my_long_options[] =
{"help", '?', "Display this help message and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Increase the output level",
0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

View File

@ -71,7 +71,7 @@ static HA_ERRORS ha_errlist[]=
{ 136,"No more room in index file" },
{ 137,"No more records (read after end of file)" },
{ 138,"Unsupported extension used for table" },
{ 139,"Too big row (>= 16 M)"},
{ 139,"Too big row"},
{ 140,"Wrong create options"},
{ 141,"Duplicate unique key or constraint on write or update"},
{ 142,"Unknown character set used"},

View File

@ -279,8 +279,10 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
length=(uint) strlen(name)+1;
if (pa->length+length >= pa->max_length)
{
pa->max_length=(pa->length+length+MALLOC_OVERHEAD+PS_MALLOC-1)/PS_MALLOC;
pa->max_length=pa->max_length*PS_MALLOC-MALLOC_OVERHEAD;
if (!(new_pos= (byte*) my_realloc((gptr) pa->str,
(uint) (pa->max_length+PS_MALLOC),
(uint) pa->max_length,
MYF(MY_WME))))
DBUG_RETURN(1);
if (new_pos != pa->str)
@ -291,7 +293,6 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
char*);
pa->str=new_pos;
}
pa->max_length+=PS_MALLOC;
}
if (pa->typelib.count >= pa->max_count-1)
{

View File

@ -39,23 +39,23 @@ SUPERCLEANFILES = mysql_version.h my_config.h
DISTCLEANFILES = sched.h $(SUPERCLEANFILES)
clean:
$(RM) -f readline/*
$(RM) -fr readline
distclean:
$(RM) -f readline/*
$(RM) -fr readline
all-local: my_config.h
# Since we include my_config.h it better exist from the beginning
link_sources:
$(CP) ../config.h my_config.h
$(RM) -f readline/*
-$(RM) -fr readline
@readline_h_ln_cmd@
# Keep automake happy
my_config.h: ../config.h
$(CP) ../config.h my_config.h
$(RM) -f readline/*
-$(RM) -fr readline
@readline_h_ln_cmd@
# These files should not be included in distributions since they are

View File

@ -252,6 +252,7 @@ inline double ulonglong2double(ulonglong value)
#define doublestore(T,V) { *((long *) T) = *((long*) &V); \
*(((long *) T)+1) = *(((long*) &V)+1); }
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))

View File

@ -57,7 +57,8 @@ typedef struct st_key_cache
int hash_links; /* max number of hash links */
int hash_links_used; /* number of hash links currently used */
int disk_blocks; /* max number of blocks in the cache */
ulong blocks_used; /* number of currently used blocks */
ulong blocks_used; /* maximum number of concurrently used blocks */
ulong blocks_unused; /* number of currently unused blocks */
ulong blocks_changed; /* number of currently dirty blocks */
ulong warm_blocks; /* number of blocks in warm sub-chain */
ulong cnt_for_resize_op; /* counter to block resize operation */
@ -65,6 +66,7 @@ typedef struct st_key_cache
HASH_LINK **hash_root; /* arr. of entries into hash table buckets */
HASH_LINK *hash_link_root; /* memory for hash table links */
HASH_LINK *free_hash_list; /* list of free hash links */
BLOCK_LINK *free_block_list; /* list of free blocks */
BLOCK_LINK *block_root; /* memory for block links */
byte HUGE_PTR *block_mem; /* memory for block buffers */
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
@ -87,7 +89,6 @@ typedef struct st_key_cache
ulong param_age_threshold; /* determines when hot block is downgraded */
/* Statistics variables */
ulong global_blocks_used; /* number of currently used blocks */
ulong global_blocks_changed; /* number of currently dirty blocks */
ulong global_cache_w_requests;/* number of write requests (write hits) */
ulong global_cache_write; /* number of writes from the cache to files */

View File

@ -90,7 +90,7 @@ enum my_lex_states
MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE,
MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_COLON,
MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON,
MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
MY_LEX_IDENT_OR_KEYWORD,

View File

@ -105,8 +105,8 @@ enum ha_extra_function {
HA_EXTRA_NORMAL=0, /* Optimize for space (def) */
HA_EXTRA_QUICK=1, /* Optimize for speed */
HA_EXTRA_RESET=2, /* Reset database to after open */
HA_EXTRA_CACHE=3, /* Cash record in HA_rrnd() */
HA_EXTRA_NO_CACHE=4, /* End cacheing of records (def) */
HA_EXTRA_CACHE=3, /* Cache record in HA_rrnd() */
HA_EXTRA_NO_CACHE=4, /* End caching of records (def) */
HA_EXTRA_NO_READCHECK=5, /* No readcheck on update */
HA_EXTRA_READCHECK=6, /* Use readcheck (def) */
HA_EXTRA_KEYREAD=7, /* Read only key to database */
@ -287,6 +287,9 @@ enum ha_base_keytype {
#define HA_ERR_ROW_IS_REFERENCED 152 /* Cannot delete a parent row */
#define HA_ERR_NO_SAVEPOINT 153 /* No savepoint with that name */
#define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154 /* Non unique key block size */
#define HA_ERR_OLD_METADATA 155 /* The frm file on disk is old */
#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */
#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */
/* Other constants */
@ -364,4 +367,7 @@ typedef ulong ha_rows;
#define MAX_FILE_SIZE LONGLONG_MAX
#endif
/* Currently used for saying which interfaces a Storage Engine implements */
#define HA_ERR_NOT_IMPLEMENTED -1
#endif /* _my_base_h */

View File

@ -681,7 +681,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FLT_MAX ((float)3.40282346638528860e+38)
#endif
#ifndef HAVE_ISINF
#if !defined(HAVE_ISINF) && !defined(isinf)
#define isinf(X) 0
#endif
@ -952,19 +952,19 @@ typedef char bool; /* Ordinary boolean values 0 1 */
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16) +\
(((uint32) ((uchar) (A)[3])) << 24)) +\
(((ulonglong) ((uchar) (A)[4])) << 32))
(((ulonglong) ((uchar) (A)[4])) << 32))
#define uint8korr(A) (*((ulonglong *) (A)))
#define sint8korr(A) (*((longlong *) (A)))
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
#define int3store(T,A) { *(T)= (uchar) ((A));\
*(T+1)=(uchar) (((uint) (A) >> 8));\
*(T+2)=(uchar) (((A) >> 16)); }
#define int3store(T,A) do { *(T)= (uchar) ((A));\
*(T+1)=(uchar) (((uint) (A) >> 8));\
*(T+2)=(uchar) (((A) >> 16)); } while (0)
#define int4store(T,A) *((long *) (T))= (long) (A)
#define int5store(T,A) { *(T)= (uchar)((A));\
*((T)+1)=(uchar) (((A) >> 8));\
*((T)+2)=(uchar) (((A) >> 16));\
*((T)+3)=(uchar) (((A) >> 24)); \
*((T)+4)=(uchar) (((A) >> 32)); }
#define int5store(T,A) do { *(T)= (uchar)((A));\
*((T)+1)=(uchar) (((A) >> 8));\
*((T)+2)=(uchar) (((A) >> 16));\
*((T)+3)=(uchar) (((A) >> 24)); \
*((T)+4)=(uchar) (((A) >> 32)); } while(0)
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
typedef union {
@ -972,19 +972,25 @@ typedef union {
long m[2];
} doubleget_union;
#define doubleget(V,M) \
{ doubleget_union _tmp; \
_tmp.m[0] = *((long*)(M)); \
_tmp.m[1] = *(((long*) (M))+1); \
(V) = _tmp.v; }
#define doublestore(T,V) { *((long *) T) = ((doubleget_union *)&V)->m[0]; \
*(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; }
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
do { doubleget_union _tmp; \
_tmp.m[0] = *((long*)(M)); \
_tmp.m[1] = *(((long*) (M))+1); \
(V) = _tmp.v; } while(0)
#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \
*(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \
} while (0)
#define float4get(V,M) do { *((long *) &(V)) = *((long*) (M)); } while(0)
#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#endif /* __i386__ */
#ifndef sint2korr
/*
We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines
were done before)
*/
#define sint2korr(A) (int16) (((int16) ((uchar) (A)[0])) +\
((int16) ((int16) (A)[1]) << 8))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
@ -1013,7 +1019,7 @@ typedef union {
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16) +\
(((uint32) ((uchar) (A)[3])) << 24)) +\
(((ulonglong) ((uchar) (A)[4])) << 32))
(((ulonglong) ((uchar) (A)[4])) << 32))
#define uint8korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16) +\
@ -1022,50 +1028,50 @@ typedef union {
(((uint32) ((uchar) (A)[5])) << 8) +\
(((uint32) ((uchar) (A)[6])) << 16) +\
(((uint32) ((uchar) (A)[7])) << 24))) <<\
32))
#define int2store(T,A) { uint def_temp= (uint) (A) ;\
*((uchar*) (T))= (uchar)(def_temp); \
*((uchar*) (T+1))=(uchar)((def_temp >> 8)); }
#define int3store(T,A) { /*lint -save -e734 */\
*((uchar*)(T))=(uchar) ((A));\
*((uchar*) (T)+1)=(uchar) (((A) >> 8));\
*((uchar*)(T)+2)=(uchar) (((A) >> 16)); \
/*lint -restore */}
#define int4store(T,A) { *(T)=(char) ((A));\
*((T)+1)=(char) (((A) >> 8));\
*((T)+2)=(char) (((A) >> 16));\
*((T)+3)=(char) (((A) >> 24)); }
#define int5store(T,A) { *(T)=((A));\
*((T)+1)=(((A) >> 8));\
*((T)+2)=(((A) >> 16));\
*((T)+3)=(((A) >> 24)); \
*((T)+4)=(((A) >> 32)); }
#define int8store(T,A) { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \
int4store((T),def_temp); \
int4store((T+4),def_temp2); \
}
32))
#define int2store(T,A) do { uint def_temp= (uint) (A) ;\
*((uchar*) (T))= (uchar)(def_temp); \
*((uchar*) (T+1))=(uchar)((def_temp >> 8)); \
} while(0)
#define int3store(T,A) do { /*lint -save -e734 */\
*((uchar*)(T))=(uchar) ((A));\
*((uchar*) (T)+1)=(uchar) (((A) >> 8));\
*((uchar*)(T)+2)=(uchar) (((A) >> 16)); \
/*lint -restore */} while(0)
#define int4store(T,A) do { *(T)=(char) ((A));\
*((T)+1)=(char) (((A) >> 8));\
*((T)+2)=(char) (((A) >> 16));\
*((T)+3)=(char) (((A) >> 24)); } while(0)
#define int5store(T,A) do { *(T)=((A));\
*((T)+1)=(((A) >> 8));\
*((T)+2)=(((A) >> 16));\
*((T)+3)=(((A) >> 24)); \
*((T)+4)=(((A) >> 32)); } while(0)
#define int8store(T,A) do { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \
int4store((T),def_temp); \
int4store((T+4),def_temp2); } while(0)
#ifdef WORDS_BIGENDIAN
#define float4store(T,A) { *(T)= ((byte *) &A)[3];\
#define float4store(T,A) do { *(T)= ((byte *) &A)[3];\
*((T)+1)=(char) ((byte *) &A)[2];\
*((T)+2)=(char) ((byte *) &A)[1];\
*((T)+3)=(char) ((byte *) &A)[0]; }
*((T)+3)=(char) ((byte *) &A)[0]; } while(0)
#define float4get(V,M) { float def_temp;\
#define float4get(V,M) do { float def_temp;\
((byte*) &def_temp)[0]=(M)[3];\
((byte*) &def_temp)[1]=(M)[2];\
((byte*) &def_temp)[2]=(M)[1];\
((byte*) &def_temp)[3]=(M)[0];\
(V)=def_temp; }
#define float8store(T,V) { *(T)= ((byte *) &V)[7];\
(V)=def_temp; } while(0)
#define float8store(T,V) do { *(T)= ((byte *) &V)[7];\
*((T)+1)=(char) ((byte *) &V)[6];\
*((T)+2)=(char) ((byte *) &V)[5];\
*((T)+3)=(char) ((byte *) &V)[4];\
*((T)+4)=(char) ((byte *) &V)[3];\
*((T)+5)=(char) ((byte *) &V)[2];\
*((T)+6)=(char) ((byte *) &V)[1];\
*((T)+7)=(char) ((byte *) &V)[0]; }
*((T)+7)=(char) ((byte *) &V)[0]; } while(0)
#define float8get(V,M) { double def_temp;\
#define float8get(V,M) do { double def_temp;\
((byte*) &def_temp)[0]=(M)[7];\
((byte*) &def_temp)[1]=(M)[6];\
((byte*) &def_temp)[2]=(M)[5];\
@ -1074,21 +1080,21 @@ typedef union {
((byte*) &def_temp)[5]=(M)[2];\
((byte*) &def_temp)[6]=(M)[1];\
((byte*) &def_temp)[7]=(M)[0];\
(V) = def_temp; }
(V) = def_temp; } while(0)
#else
#define float4get(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float))
#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float))
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define doublestore(T,V) { *(T)= ((byte *) &V)[4];\
#define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\
*((T)+1)=(char) ((byte *) &V)[5];\
*((T)+2)=(char) ((byte *) &V)[6];\
*((T)+3)=(char) ((byte *) &V)[7];\
*((T)+4)=(char) ((byte *) &V)[0];\
*((T)+5)=(char) ((byte *) &V)[1];\
*((T)+6)=(char) ((byte *) &V)[2];\
*((T)+7)=(char) ((byte *) &V)[3]; }
#define doubleget(V,M) { double def_temp;\
*((T)+7)=(char) ((byte *) &V)[3]; } while(0)
#define doubleget(V,M) do { double def_temp;\
((byte*) &def_temp)[0]=(M)[4];\
((byte*) &def_temp)[1]=(M)[5];\
((byte*) &def_temp)[2]=(M)[6];\
@ -1097,7 +1103,7 @@ typedef union {
((byte*) &def_temp)[5]=(M)[1];\
((byte*) &def_temp)[6]=(M)[2];\
((byte*) &def_temp)[7]=(M)[3];\
(V) = def_temp; }
(V) = def_temp; } while(0)
#endif /* __FLOAT_WORD_ORDER */
#define float8get(V,M) doubleget((V),(M))
@ -1114,30 +1120,31 @@ typedef union {
#ifdef WORDS_BIGENDIAN
#define ushortget(V,M) { V = (uint16) (((uint16) ((uchar) (M)[1]))+\
((uint16) ((uint16) (M)[0]) << 8)); }
#define shortget(V,M) { V = (short) (((short) ((uchar) (M)[1]))+\
((short) ((short) (M)[0]) << 8)); }
#define longget(V,M) { int32 def_temp;\
((byte*) &def_temp)[0]=(M)[0];\
((byte*) &def_temp)[1]=(M)[1];\
((byte*) &def_temp)[2]=(M)[2];\
((byte*) &def_temp)[3]=(M)[3];\
(V)=def_temp; }
#define ulongget(V,M) { uint32 def_temp;\
((byte*) &def_temp)[0]=(M)[0];\
((byte*) &def_temp)[1]=(M)[1];\
((byte*) &def_temp)[2]=(M)[2];\
((byte*) &def_temp)[3]=(M)[3];\
(V)=def_temp; }
#define shortstore(T,A) { uint def_temp=(uint) (A) ;\
*(T+1)=(char)(def_temp); \
*(T+0)=(char)(def_temp >> 8); }
#define longstore(T,A) { *((T)+3)=((A));\
*((T)+2)=(((A) >> 8));\
*((T)+1)=(((A) >> 16));\
*((T)+0)=(((A) >> 24)); }
#define ushortget(V,M) do { V = (uint16) (((uint16) ((uchar) (M)[1]))+\
((uint16) ((uint16) (M)[0]) << 8)); } while(0)
#define shortget(V,M) do { V = (short) (((short) ((uchar) (M)[1]))+\
((short) ((short) (M)[0]) << 8)); } while(0)
#define longget(V,M) do { int32 def_temp;\
((byte*) &def_temp)[0]=(M)[0];\
((byte*) &def_temp)[1]=(M)[1];\
((byte*) &def_temp)[2]=(M)[2];\
((byte*) &def_temp)[3]=(M)[3];\
(V)=def_temp; } while(0)
#define ulongget(V,M) do { uint32 def_temp;\
((byte*) &def_temp)[0]=(M)[0];\
((byte*) &def_temp)[1]=(M)[1];\
((byte*) &def_temp)[2]=(M)[2];\
((byte*) &def_temp)[3]=(M)[3];\
(V)=def_temp; } while(0)
#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\
*(T+1)=(char)(def_temp); \
*(T+0)=(char)(def_temp >> 8); } while(0)
#define longstore(T,A) do { *((T)+3)=((A));\
*((T)+2)=(((A) >> 8));\
*((T)+1)=(((A) >> 16));\
*((T)+0)=(((A) >> 24)); } while(0)
#define floatstore(T,V) memcpy_fixed((byte*)(T), (byte*)(&V), sizeof(float))
#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))
#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double))
#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong))
@ -1145,12 +1152,15 @@ typedef union {
#else
#define ushortget(V,M) { V = uint2korr(M); }
#define shortget(V,M) { V = sint2korr(M); }
#define longget(V,M) { V = sint4korr(M); }
#define ulongget(V,M) { V = uint4korr(M); }
#define ushortget(V,M) do { V = uint2korr(M); } while(0)
#define shortget(V,M) do { V = sint2korr(M); } while(0)
#define longget(V,M) do { V = sint4korr(M); } while(0)
#define ulongget(V,M) do { V = uint4korr(M); } while(0)
#define shortstore(T,V) int2store(T,V)
#define longstore(T,V) int4store(T,V)
#ifndef floatstore
#define floatstore(T,V) memcpy_fixed((byte*)(T), (byte*)(&V), sizeof(float))
#endif
#ifndef doubleget
#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))
#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double))

View File

@ -36,7 +36,7 @@ extern "C" {
/* defines used by myisam-funktions */
/* The following defines can be increased if necessary */
#define MI_MAX_KEY 32 /* Max allowed keys */
#define MI_MAX_KEY 64 /* Max allowed keys */
#define MI_MAX_KEY_SEG 16 /* Max segments for key */
#define MI_MAX_KEY_LENGTH 1000
@ -192,7 +192,7 @@ extern uint myisam_block_size;
extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
extern my_bool myisam_concurrent_insert;
extern my_off_t myisam_max_temp_length,myisam_max_extra_temp_length;
extern ulong myisam_bulk_insert_tree_size;
extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
/* Prototypes for myisam-functions */

View File

@ -87,8 +87,8 @@ typedef struct st_mysql_field {
char *db; /* Database for table */
char *catalog; /* Catalog for table */
char *def; /* Default value (set by mysql_list_fields) */
unsigned long length; /* Width of column */
unsigned long max_length; /* Max width of selected set */
unsigned long length; /* Width of column (create length) */
unsigned long max_length; /* Max width for selected set */
unsigned int name_length;
unsigned int org_name_length;
unsigned int table_length;
@ -120,6 +120,7 @@ typedef unsigned long long my_ulonglong;
typedef struct st_mysql_rows {
struct st_mysql_rows *next; /* list of rows */
MYSQL_ROW data;
unsigned long length;
} MYSQL_ROWS;
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
@ -547,12 +548,14 @@ typedef struct st_mysql_bind
unsigned long offset; /* offset position for char/binary fetch */
unsigned long internal_length; /* Used if length is 0 */
unsigned int param_number; /* For null count and error messages */
unsigned int pack_length; /* Internal length for packed data */
my_bool is_unsigned; /* set if integer type is unsigned */
my_bool long_data_used; /* If used with mysql_send_long_data */
my_bool binary_data; /* data buffer is binary */
my_bool null_field; /* NULL data cache flag */
my_bool internal_is_null; /* Used if is_null is 0 */
void (*store_param_func)(NET *net, struct st_mysql_bind *param);
void (*fetch_result)(struct st_mysql_bind *, unsigned char **row);
void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
unsigned char **row);
} MYSQL_BIND;
@ -589,8 +592,25 @@ typedef struct st_mysql_stmt
my_bool bind_result_done; /* output buffers were supplied */
/* mysql_stmt_close() had to cancel this result */
my_bool unbuffered_fetch_cancelled;
/*
Is set to true if we need to calculate field->max_length for
metadata fields when doing mysql_stmt_store_result.
*/
my_bool update_max_length;
} MYSQL_STMT;
enum enum_stmt_attr_type
{
/*
When doing mysql_stmt_store_result calculate max_length attribute
of statement metadata. This is to be consistent with the old API,
where this was done automatically.
In the new API we do that only by request because it slows down
mysql_stmt_store_result sufficiently.
*/
STMT_ATTR_UPDATE_MAX_LENGTH
};
typedef struct st_mysql_methods
{
@ -648,6 +668,12 @@ int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
unsigned long offset);
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
enum enum_stmt_attr_type attr_type,
const void *attr);
my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
enum enum_stmt_attr_type attr_type,
void *attr);
my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);

View File

@ -226,17 +226,6 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM
#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY
#if TO_BE_INCLUDED_LATER
/* For bind applications, to indicate unsigned buffers */
#define MYSQL_TYPE_UTINY -10
#define MYSQL_TYPE_USHORT -9
#define MYSQL_TYPE_ULONG -8
#define MYSQL_TYPE_UFLOAT -7
#define MYSQL_TYPE_UDOUBLE -6
#define MYSQL_TYPE_ULONGLONG -5
#define MYSQL_TYPE_UINT24 -4
#endif
/* options for mysql_set_option */
enum enum_mysql_set_option
{

View File

@ -26,6 +26,7 @@
#undef HAVE_OPENSSL
#undef HAVE_ISAM
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#define DONT_USE_RAID

View File

@ -311,41 +311,42 @@
#define ER_TRUNCATED_WRONG_VALUE 1292
#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293
#define ER_INVALID_ON_UPDATE 1294
#define ER_SP_NO_RECURSIVE_CREATE 1295
#define ER_SP_ALREADY_EXISTS 1296
#define ER_SP_DOES_NOT_EXIST 1297
#define ER_SP_DROP_FAILED 1298
#define ER_SP_STORE_FAILED 1299
#define ER_SP_LILABEL_MISMATCH 1300
#define ER_SP_LABEL_REDEFINE 1301
#define ER_SP_LABEL_MISMATCH 1302
#define ER_SP_UNINIT_VAR 1303
#define ER_SP_BADSELECT 1304
#define ER_SP_BADRETURN 1305
#define ER_SP_BADSTATEMENT 1306
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1307
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1308
#define ER_QUERY_INTERRUPTED 1309
#define ER_SP_WRONG_NO_OF_ARGS 1310
#define ER_SP_COND_MISMATCH 1311
#define ER_SP_NORETURN 1312
#define ER_SP_NORETURNEND 1313
#define ER_SP_BAD_CURSOR_QUERY 1314
#define ER_SP_BAD_CURSOR_SELECT 1315
#define ER_SP_CURSOR_MISMATCH 1316
#define ER_SP_CURSOR_ALREADY_OPEN 1317
#define ER_SP_CURSOR_NOT_OPEN 1318
#define ER_SP_UNDECLARED_VAR 1319
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1320
#define ER_SP_FETCH_NO_DATA 1321
#define ER_SP_DUP_PARAM 1322
#define ER_SP_DUP_VAR 1323
#define ER_SP_DUP_COND 1324
#define ER_SP_DUP_CURS 1325
#define ER_SP_CANT_ALTER 1326
#define ER_SP_SUBSELECT_NYI 1327
#define ER_SP_NO_USE 1328
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1329
#define ER_SP_CURSOR_AFTER_HANDLER 1330
#define ER_SP_CASE_NOT_FOUND 1331
#define ER_ERROR_MESSAGES 332
#define ER_UNSUPPORTED_PS 1295
#define ER_SP_NO_RECURSIVE_CREATE 1296
#define ER_SP_ALREADY_EXISTS 1297
#define ER_SP_DOES_NOT_EXIST 1298
#define ER_SP_DROP_FAILED 1299
#define ER_SP_STORE_FAILED 1300
#define ER_SP_LILABEL_MISMATCH 1301
#define ER_SP_LABEL_REDEFINE 1302
#define ER_SP_LABEL_MISMATCH 1303
#define ER_SP_UNINIT_VAR 1304
#define ER_SP_BADSELECT 1305
#define ER_SP_BADRETURN 1306
#define ER_SP_BADSTATEMENT 1307
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1308
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1309
#define ER_QUERY_INTERRUPTED 1310
#define ER_SP_WRONG_NO_OF_ARGS 1311
#define ER_SP_COND_MISMATCH 1312
#define ER_SP_NORETURN 1313
#define ER_SP_NORETURNEND 1314
#define ER_SP_BAD_CURSOR_QUERY 1315
#define ER_SP_BAD_CURSOR_SELECT 1316
#define ER_SP_CURSOR_MISMATCH 1317
#define ER_SP_CURSOR_ALREADY_OPEN 1318
#define ER_SP_CURSOR_NOT_OPEN 1319
#define ER_SP_UNDECLARED_VAR 1320
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1321
#define ER_SP_FETCH_NO_DATA 1322
#define ER_SP_DUP_PARAM 1323
#define ER_SP_DUP_VAR 1324
#define ER_SP_DUP_COND 1325
#define ER_SP_DUP_CURS 1326
#define ER_SP_CANT_ALTER 1327
#define ER_SP_SUBSELECT_NYI 1328
#define ER_SP_NO_USE 1329
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1330
#define ER_SP_CURSOR_AFTER_HANDLER 1331
#define ER_SP_CASE_NOT_FOUND 1332
#define ER_ERROR_MESSAGES 333

View File

@ -589,28 +589,29 @@ btr_page_get_father_for_rec(
if (btr_node_ptr_get_child_page_no(node_ptr) !=
buf_frame_get_page_no(page)) {
fprintf(stderr,
"InnoDB: Dump of the child page:\n");
fputs("InnoDB: Dump of the child page:\n", stderr);
buf_page_print(buf_frame_align(page));
fprintf(stderr,
"InnoDB: Dump of the parent page:\n");
fputs("InnoDB: Dump of the parent page:\n", stderr);
buf_page_print(buf_frame_align(node_ptr));
fprintf(stderr,
"InnoDB: Corruption of an index tree: table %s, index %s,\n"
fputs("InnoDB: Corruption of an index tree: table ", stderr);
ut_print_name(stderr,
UT_LIST_GET_FIRST(tree->tree_indexes)->table_name);
fputs(", index ", stderr);
ut_print_name(stderr,
UT_LIST_GET_FIRST(tree->tree_indexes)->name);
fprintf(stderr, ",\n"
"InnoDB: father ptr page no %lu, child page no %lu\n",
(UT_LIST_GET_FIRST(tree->tree_indexes))->table_name,
(UT_LIST_GET_FIRST(tree->tree_indexes))->name,
(unsigned long) btr_node_ptr_get_child_page_no(node_ptr),
(unsigned long) buf_frame_get_page_no(page));
(ulong) btr_node_ptr_get_child_page_no(node_ptr),
(ulong) buf_frame_get_page_no(page));
page_rec_print(page_rec_get_next(page_get_infimum_rec(page)));
page_rec_print(node_ptr);
fprintf(stderr,
fputs(
"InnoDB: You should dump + drop + reimport the table to fix the\n"
"InnoDB: corruption. If the crash happens at the database startup, see\n"
"InnoDB: section 6.1 of http://www.innodb.com/ibman.html about forcing\n"
"InnoDB: recovery. Then dump + drop + reimport.\n");
"InnoDB: section 6.1 of http://www.innodb.com/ibman.php about forcing\n"
"InnoDB: recovery. Then dump + drop + reimport.\n", stderr);
}
ut_a(btr_node_ptr_get_child_page_no(node_ptr) ==
@ -1053,7 +1054,7 @@ btr_root_raise_and_insert(
/* We play safe and reset the free bits for the new page */
/* printf("Root raise new page no %lu\n",
/* fprintf(stderr, "Root raise new page no %lu\n",
buf_frame_get_page_no(new_page)); */
ibuf_reset_free_bits(UT_LIST_GET_FIRST(tree->tree_indexes),
@ -1602,7 +1603,7 @@ func_start:
/* 5. Move then the records to the new page */
if (direction == FSP_DOWN) {
/* printf("Split left\n"); */
/* fputs("Split left\n", stderr); */
page_move_rec_list_start(new_page, page, move_limit, mtr);
left_page = new_page;
@ -1610,7 +1611,7 @@ func_start:
lock_update_split_left(right_page, left_page);
} else {
/* printf("Split right\n"); */
/* fputs("Split right\n", stderr); */
page_move_rec_list_end(new_page, page, move_limit, mtr);
left_page = page;
@ -1646,7 +1647,7 @@ func_start:
ibuf_update_free_bits_for_two_pages_low(cursor->index,
left_page,
right_page, mtr);
/* printf("Split and insert done %lu %lu\n",
/* fprintf(stderr, "Split and insert done %lu %lu\n",
buf_frame_get_page_no(left_page),
buf_frame_get_page_no(right_page)); */
return(rec);
@ -1666,7 +1667,7 @@ func_start:
/* We play safe and reset the free bits for new_page */
ibuf_reset_free_bits(cursor->index, new_page);
/* printf("Split second round %lu\n",
/* fprintf(stderr, "Split second round %lu\n",
buf_frame_get_page_no(page)); */
n_iterations++;
ut_ad(n_iterations < 2);
@ -1680,7 +1681,7 @@ func_start:
ibuf_update_free_bits_for_two_pages_low(cursor->index, left_page,
right_page, mtr);
/* printf("Split and insert done %lu %lu\n",
/* fprintf(stderr, "Split and insert done %lu %lu\n",
buf_frame_get_page_no(left_page),
buf_frame_get_page_no(right_page)); */
@ -1927,7 +1928,7 @@ btr_compress(
left_page_no = btr_page_get_prev(page, mtr);
right_page_no = btr_page_get_next(page, mtr);
/* printf("Merge left page %lu right %lu \n", left_page_no,
/* fprintf(stderr, "Merge left page %lu right %lu \n", left_page_no,
right_page_no); */
node_ptr = btr_page_get_father_node_ptr(tree, page, mtr);
@ -2164,6 +2165,7 @@ btr_discard_page(
ut_ad(btr_check_node_ptr(tree, merge_page, mtr));
}
#ifdef UNIV_DEBUG
/*****************************************************************
Prints size info of a B-tree. */
@ -2177,8 +2179,9 @@ btr_print_size(
mtr_t mtr;
if (tree->type & DICT_IBUF) {
printf(
"Sorry, cannot print info of an ibuf tree: use ibuf functions\n");
fputs(
"Sorry, cannot print info of an ibuf tree: use ibuf functions\n",
stderr);
return;
}
@ -2189,14 +2192,14 @@ btr_print_size(
seg = root + PAGE_HEADER + PAGE_BTR_SEG_TOP;
printf("INFO OF THE NON-LEAF PAGE SEGMENT\n");
fputs("INFO OF THE NON-LEAF PAGE SEGMENT\n", stderr);
fseg_print(seg, &mtr);
if (!(tree->type & DICT_UNIVERSAL)) {
seg = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF;
printf("INFO OF THE LEAF PAGE SEGMENT\n");
fputs("INFO OF THE LEAF PAGE SEGMENT\n", stderr);
fseg_print(seg, &mtr);
}
@ -2224,7 +2227,7 @@ btr_print_recursive(
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_X_FIX));
printf("NODE ON LEVEL %lu page number %lu\n",
fprintf(stderr, "NODE ON LEVEL %lu page number %lu\n",
(ulong) btr_page_get_level(page, mtr),
(ulong) buf_frame_get_page_no(page));
@ -2271,8 +2274,8 @@ btr_print_tree(
mtr_t mtr;
page_t* root;
printf("--------------------------\n");
printf("INDEX TREE PRINT\n");
fputs("--------------------------\n"
"INDEX TREE PRINT\n", stderr);
mtr_start(&mtr);
@ -2284,6 +2287,7 @@ btr_print_tree(
btr_validate_tree(tree);
}
#endif /* UNIV_DEBUG */
/****************************************************************
Checks that the node pointer to a page is appropriate. */
@ -2328,6 +2332,22 @@ btr_check_node_ptr(
return(TRUE);
}
/****************************************************************
Display identification information for a record. */
static
void
btr_index_rec_validate_report(
/*==========================*/
page_t* page, /* in: index page */
rec_t* rec, /* in: index record */
dict_index_t* index) /* in: index */
{
fputs("InnoDB: Record in ", stderr);
dict_index_name_print(stderr, index);
fprintf(stderr, ", page %lu, at offset %lu\n",
buf_frame_get_page_no(page), (ulint)(rec - page));
}
/****************************************************************
Checks the size and number of fields in a record based on the definition of
the index. */
@ -2342,13 +2362,10 @@ btr_index_rec_validate(
should print hex dump of record
and page on error */
{
dtype_t* type;
byte* data;
ulint len;
ulint n;
ulint i;
page_t* page;
char err_buf[1000];
page = buf_frame_align(rec);
@ -2363,14 +2380,9 @@ btr_index_rec_validate(
n = dict_index_get_n_fields(index);
if (rec_get_n_fields(rec) != n) {
fprintf(stderr,
"InnoDB: Record in index %s in table %s, page %lu, at offset %lu\n"
"InnoDB: has %lu fields, should have %lu\n",
index->name, index->table_name,
(unsigned long) buf_frame_get_page_no(page),
(unsigned long) (rec - page),
(unsigned long) rec_get_n_fields(rec),
(unsigned long) n);
btr_index_rec_validate_report(page, rec, index);
fprintf(stderr, "InnoDB: has %lu fields, should have %lu\n",
(ulong) rec_get_n_fields(rec), (ulong) n);
if (!dump_on_error) {
@ -2379,16 +2391,17 @@ btr_index_rec_validate(
buf_page_print(page);
rec_sprintf(err_buf, 900, rec);
fprintf(stderr, "InnoDB: corrupt record %s\n", err_buf);
fputs("InnoDB: corrupt record ", stderr);
rec_print(stderr, rec);
putc('\n', stderr);
return(FALSE);
}
for (i = 0; i < n; i++) {
data = rec_get_nth_field(rec, i, &len);
dtype_t* type = dict_index_get_nth_type(index, i);
type = dict_index_get_nth_type(index, i);
rec_get_nth_field(rec, i, &len);
if ((dict_index_get_nth_field(index, i)->prefix_len == 0
&& len != UNIV_SQL_NULL && dtype_is_fixed_size(type)
@ -2399,15 +2412,10 @@ btr_index_rec_validate(
&& len !=
dict_index_get_nth_field(index, i)->prefix_len)) {
btr_index_rec_validate_report(page, rec, index);
fprintf(stderr,
"InnoDB: Record in index %s in table %s, page %lu, at offset %lu\n"
"InnoDB: field %lu len is %lu, should be %lu\n",
index->name, index->table_name,
(unsigned long) buf_frame_get_page_no(page),
(unsigned long) (rec - page),
(unsigned long) i,
(unsigned long) len,
(unsigned long) dtype_get_fixed_size(type));
(ulong) i, (ulong) len, (ulong) dtype_get_fixed_size(type));
if (!dump_on_error) {
@ -2416,9 +2424,9 @@ btr_index_rec_validate(
buf_page_print(page);
rec_sprintf(err_buf, 900, rec);
fprintf(stderr,
"InnoDB: corrupt record %s\n", err_buf);
fputs("InnoDB: corrupt record ", stderr);
rec_print(stderr, rec);
putc('\n', stderr);
return(FALSE);
}
@ -2438,7 +2446,6 @@ btr_index_page_validate(
page_t* page, /* in: index page */
dict_index_t* index) /* in: index */
{
rec_t* rec;
page_cur_t cur;
ibool ret = TRUE;
@ -2446,14 +2453,12 @@ btr_index_page_validate(
page_cur_move_to_next(&cur);
for (;;) {
rec = (&cur)->rec;
if (page_cur_is_after_last(&cur)) {
break;
}
if (!btr_index_rec_validate(rec, index, TRUE)) {
if (!btr_index_rec_validate(cur.rec, index, TRUE)) {
return(FALSE);
}
@ -2464,6 +2469,46 @@ btr_index_page_validate(
return(ret);
}
/****************************************************************
Report an error on one page of an index tree. */
static
void
btr_validate_report1(
/* out: TRUE if ok */
dict_index_t* index, /* in: index */
ulint level, /* in: B-tree level */
page_t* page) /* in: index page */
{
fprintf(stderr, "InnoDB: Error in page %lu of ",
buf_frame_get_page_no(page));
dict_index_name_print(stderr, index);
if (level) {
fprintf(stderr, ", index tree level %lu", level);
}
putc('\n', stderr);
}
/****************************************************************
Report an error on two pages of an index tree. */
static
void
btr_validate_report2(
/* out: TRUE if ok */
dict_index_t* index, /* in: index */
ulint level, /* in: B-tree level */
page_t* page1, /* in: first index page */
page_t* page2) /* in: second index page */
{
fprintf(stderr, "InnoDB: Error in pages %lu and %lu of ",
buf_frame_get_page_no(page1),
buf_frame_get_page_no(page2));
dict_index_name_print(stderr, index);
if (level) {
fprintf(stderr, ", index tree level %lu", level);
}
putc('\n', stderr);
}
/****************************************************************
Validates index tree level. */
static
@ -2489,7 +2534,6 @@ btr_validate_level(
ibool ret = TRUE;
dict_index_t* index;
mtr_t mtr;
char err_buf[1000];
mtr_start(&mtr);
@ -2520,10 +2564,7 @@ loop:
/* Check ordering etc. of records */
if (!page_validate(page, index)) {
fprintf(stderr,
"InnoDB: Error in page %lu in index %s table %s, index tree level %lu\n",
(ulong) buf_frame_get_page_no(page), index->name,
index->table_name, (ulong) level);
btr_validate_report1(index, level, page);
ret = FALSE;
} else if (level == 0) {
@ -2553,25 +2594,22 @@ loop:
page_rec_get_next(page_get_infimum_rec(right_page)),
UT_LIST_GET_FIRST(tree->tree_indexes)) >= 0) {
fprintf(stderr,
"InnoDB: Error on pages %lu and %lu in index %s table %s\n",
(ulong) buf_frame_get_page_no(page),
(ulong) right_page_no,
index->name, index->table_name);
btr_validate_report2(index, level, page, right_page);
fprintf(stderr,
"InnoDB: records in wrong order on adjacent pages\n");
fputs("InnoDB: records in wrong order"
" on adjacent pages\n", stderr);
buf_page_print(page);
buf_page_print(right_page);
rec_sprintf(err_buf, 900,
page_rec_get_prev(page_get_supremum_rec(page)));
fprintf(stderr, "InnoDB: record %s\n", err_buf);
rec_sprintf(err_buf, 900,
page_rec_get_next(page_get_infimum_rec(right_page)));
fprintf(stderr, "InnoDB: record %s\n", err_buf);
fputs("InnoDB: record ", stderr);
rec_print(stderr, page_rec_get_prev(
page_get_supremum_rec(page)));
putc('\n', stderr);
fputs("InnoDB: record ", stderr);
rec_print(stderr, page_rec_get_next(
page_get_infimum_rec(right_page)));
putc('\n', stderr);
ret = FALSE;
}
@ -2594,32 +2632,27 @@ loop:
|| node_ptr != btr_page_get_father_for_rec(tree, page,
page_rec_get_prev(page_get_supremum_rec(page)),
&mtr)) {
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
(unsigned long) buf_frame_get_page_no(page),
index->name, index->table_name);
btr_validate_report1(index, level, page);
fprintf(stderr,
"InnoDB: node pointer to the page is wrong\n");
fputs("InnoDB: node pointer to the page is wrong\n",
stderr);
buf_page_print(father_page);
buf_page_print(page);
rec_sprintf(err_buf, 900, node_ptr);
fprintf(stderr, "InnoDB: node ptr %s\n", err_buf);
fputs("InnoDB: node ptr ", stderr);
rec_print(stderr, node_ptr);
fprintf(stderr,
fprintf(stderr, "\n"
"InnoDB: node ptr child page n:o %lu\n",
(unsigned long) btr_node_ptr_get_child_page_no(node_ptr));
rec_sprintf(err_buf, 900,
fputs("InnoDB: record on page ", stderr);
rec_print(stderr,
btr_page_get_father_for_rec(tree, page,
page_rec_get_prev(page_get_supremum_rec(page)),
&mtr));
fprintf(stderr, "InnoDB: record on page %s\n",
err_buf);
putc('\n', stderr);
ret = FALSE;
goto node_ptr_fails;
@ -2637,27 +2670,19 @@ loop:
if (cmp_dtuple_rec(node_ptr_tuple, node_ptr) != 0) {
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
(ulong) buf_frame_get_page_no(page),
index->name, index->table_name);
btr_validate_report1(index, level, page);
buf_page_print(father_page);
buf_page_print(page);
fprintf(stderr,
"InnoDB: Error: node ptrs differ on levels > 0\n");
rec_sprintf(err_buf, 900, node_ptr);
fprintf(stderr, "InnoDB: node ptr %s\n",
err_buf);
rec_sprintf(err_buf, 900,
page_rec_get_next(
fputs("InnoDB: Error: node ptrs differ"
" on levels > 0\n"
"InnoDB: node ptr ", stderr);
rec_print(stderr, node_ptr);
fputs("InnoDB: first rec ", stderr);
rec_print(stderr, page_rec_get_next(
page_get_infimum_rec(page)));
fprintf(stderr, "InnoDB: first rec %s\n",
err_buf);
putc('\n', stderr);
ret = FALSE;
mem_heap_free(heap);
@ -2689,13 +2714,12 @@ loop:
if (right_node_ptr !=
page_rec_get_next(node_ptr)) {
ret = FALSE;
fprintf(stderr,
"InnoDB: node pointer to the right page is wrong\n");
fputs(
"InnoDB: node pointer to the right page is wrong\n",
stderr);
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
(unsigned long) buf_frame_get_page_no(page),
index->name, index->table_name);
btr_validate_report1(index, level,
page);
buf_page_print(father_page);
buf_page_print(page);
@ -2709,13 +2733,12 @@ loop:
page_get_infimum_rec(
right_father_page))) {
ret = FALSE;
fprintf(stderr,
"InnoDB: node pointer 2 to the right page is wrong\n");
fputs(
"InnoDB: node pointer 2 to the right page is wrong\n",
stderr);
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
(unsigned long) buf_frame_get_page_no(page),
index->name, index->table_name);
btr_validate_report1(index, level,
page);
buf_page_print(father_page);
buf_page_print(right_father_page);
@ -2727,13 +2750,12 @@ loop:
!= btr_page_get_next(father_page, &mtr)) {
ret = FALSE;
fprintf(stderr,
"InnoDB: node pointer 3 to the right page is wrong\n");
fputs(
"InnoDB: node pointer 3 to the right page is wrong\n",
stderr);
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
(unsigned long) buf_frame_get_page_no(page),
index->name, index->table_name);
btr_validate_report1(index, level,
page);
buf_page_print(father_page);
buf_page_print(right_father_page);

View File

@ -120,7 +120,6 @@ static
void
btr_cur_latch_leaves(
/*=================*/
dict_tree_t* tree __attribute__((unused)), /* in: index tree */
page_t* page, /* in: leaf page where the search
converged */
ulint space, /* in: space id */
@ -133,7 +132,7 @@ btr_cur_latch_leaves(
ulint right_page_no;
page_t* get_page;
ut_ad(tree && page && mtr);
ut_ad(page && mtr);
if (latch_mode == BTR_SEARCH_LEAF) {
@ -366,17 +365,19 @@ btr_cur_search_to_nth_level(
B-tree. These let us end up in the right B-tree leaf. In that leaf
we use the original search mode. */
if (mode == PAGE_CUR_GE) {
switch (mode) {
case PAGE_CUR_GE:
page_mode = PAGE_CUR_L;
} else if (mode == PAGE_CUR_G) {
break;
case PAGE_CUR_G:
page_mode = PAGE_CUR_LE;
} else if (mode == PAGE_CUR_LE) {
page_mode = PAGE_CUR_LE;
} else if (mode == PAGE_CUR_LE_OR_EXTENDS) {
page_mode = PAGE_CUR_LE_OR_EXTENDS;
} else {
ut_ad(mode == PAGE_CUR_L);
page_mode = PAGE_CUR_L;
break;
default:
ut_ad(mode == PAGE_CUR_L
|| mode == PAGE_CUR_LE
|| mode == PAGE_CUR_LE_OR_EXTENDS);
page_mode = mode;
break;
}
/* Loop and search until we arrive at the desired level */
@ -451,7 +452,7 @@ retry_page_get:
if (height == 0) {
if (rw_latch == RW_NO_LATCH) {
btr_cur_latch_leaves(tree, page, space,
btr_cur_latch_leaves(page, space,
page_no, latch_mode, cursor,
mtr);
}
@ -478,6 +479,9 @@ retry_page_get:
/* If this is the desired level, leave the loop */
ut_ad(height
== btr_page_get_level(page_cur_get_page(page_cursor), mtr));
if (level == height) {
if (level > 0) {
@ -591,7 +595,7 @@ btr_cur_open_at_index_side(
}
if (height == 0) {
btr_cur_latch_leaves(tree, page, space, page_no,
btr_cur_latch_leaves(page, space, page_no,
latch_mode, cursor, mtr);
/* In versions <= 3.23.52 we had forgotten to
@ -697,7 +701,7 @@ btr_cur_open_at_rnd_pos(
}
if (height == 0) {
btr_cur_latch_leaves(tree, page, space, page_no,
btr_cur_latch_leaves(page, space, page_no,
latch_mode, cursor, mtr);
}
@ -829,6 +833,24 @@ btr_cur_ins_lock_and_undo(
return(DB_SUCCESS);
}
/*****************************************************************
Report information about a transaction. */
static
void
btr_cur_trx_report(
/*===============*/
const trx_t* trx, /* in: transaction */
const dict_index_t* index, /* in: index */
const char* op) /* in: operation */
{
fprintf(stderr, "Trx with id %lu %lu going to ",
ut_dulint_get_high(trx->id),
ut_dulint_get_low(trx->id));
fputs(op, stderr);
dict_index_name_print(stderr, index);
putc('\n', stderr);
}
/*****************************************************************
Tries to perform an insert to a page in an index tree, next to cursor.
It is assumed that mtr holds an x-latch on the page. The operation does
@ -876,18 +898,13 @@ btr_cur_optimistic_insert(
index = cursor->index;
if (!dtuple_check_typed_no_assert(entry)) {
fprintf(stderr,
"InnoDB: Error in a tuple to insert into table %s index %s\n",
index->table_name, index->name);
fputs("InnoDB: Error in a tuple to insert into ", stderr);
dict_index_name_print(stderr, index);
}
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to insert to table %s index %s\n",
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
dtuple_print(entry);
btr_cur_trx_report(thr_get_trx(thr), index, "insert into ");
dtuple_print(stderr, entry);
}
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
@ -980,21 +997,15 @@ calculate_sizes_again:
*rec = page_cur_tuple_insert(page_cursor, entry, mtr);
if (!(*rec)) {
char* err_buf = mem_alloc(1000);
dtuple_sprintf(err_buf, 900, entry);
fprintf(stderr,
"InnoDB: Error: cannot insert tuple %s to index %s of table %s\n"
"InnoDB: max insert size %lu\n",
err_buf, index->name, index->table->name,
(unsigned long) max_size);
mem_free(err_buf);
if (!*rec) {
fputs("InnoDB: Error: cannot insert tuple ", stderr);
dtuple_print(stderr, entry);
fputs(" into ", stderr);
dict_index_name_print(stderr, index);
fprintf(stderr, "\nInnoDB: max insert size %lu\n",
(ulong) max_size);
ut_error;
}
ut_a(*rec); /* <- We calculated above the record would fit */
}
#ifdef BTR_CUR_HASH_ADAPT
@ -1010,7 +1021,8 @@ calculate_sizes_again:
lock_update_insert(*rec);
}
/* printf("Insert to page %lu, max ins size %lu, rec %lu ind type %lu\n",
/* fprintf(stderr, "Insert into page %lu, max ins size %lu,"
" rec %lu ind type %lu\n",
buf_frame_get_page_no(page), max_size,
rec_size + PAGE_DIR_SLOT_SIZE, type);
*/
@ -1363,12 +1375,8 @@ btr_cur_update_in_place(
trx = thr_get_trx(thr);
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to update table %s index %s\n",
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
rec_print(rec);
btr_cur_trx_report(trx, index, "update ");
rec_print(stderr, rec);
}
/* Do lock checking and undo logging */
@ -1467,12 +1475,8 @@ btr_cur_optimistic_update(
index = cursor->index;
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to update table %s index %s\n",
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
rec_print(rec);
btr_cur_trx_report(thr_get_trx(thr), index, "update ");
rec_print(stderr, rec);
}
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
@ -2016,12 +2020,8 @@ btr_cur_del_mark_set_clust_rec(
index = cursor->index;
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to del mark table %s index %s\n",
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
rec_print(rec);
btr_cur_trx_report(thr_get_trx(thr), index, "del mark ");
rec_print(stderr, rec);
}
ut_ad(index->type & DICT_CLUSTERED);
@ -2156,12 +2156,9 @@ btr_cur_del_mark_set_sec_rec(
rec = btr_cur_get_rec(cursor);
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to del mark table %s index %s\n",
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
cursor->index->table_name, cursor->index->name);
rec_print(rec);
btr_cur_trx_report(thr_get_trx(thr), cursor->index,
"del mark ");
rec_print(stderr, rec);
}
err = lock_sec_rec_modify_check_and_lock(flags, rec, cursor->index,

View File

@ -803,7 +803,7 @@ btr_search_guess_on_hash(
success = FALSE;
/*
printf("Tree id %lu, page index id %lu fold %lu\n",
fprintf(stderr, "Tree id %lu, page index id %lu fold %lu\n",
ut_dulint_get_low(tree_id),
ut_dulint_get_low(btr_page_get_index_id(page)),
fold);
@ -1517,8 +1517,9 @@ check_next_rec:
ha_insert_for_fold(table, ins_fold, ins_rec);
/*
printf("Hash insert for %s, fold %lu\n",
cursor->index->name, ins_fold);
fputs("Hash insert for ", stderr);
dict_index_name_print(stderr, cursor->index);
fprintf(stderr, " fold %lu\n", ins_fold);
*/
} else {
ha_insert_for_fold(table, next_fold, next_rec);
@ -1545,7 +1546,6 @@ btr_search_validate(void)
ulint n_page_dumps = 0;
ibool ok = TRUE;
ulint i;
char rec_str[500];
rw_lock_x_lock(&btr_search_latch);
@ -1566,29 +1566,25 @@ btr_search_validate(void)
fprintf(stderr,
" InnoDB: Error in an adaptive hash index pointer to page %lu\n"
"ptr mem address %lu index id %lu %lu, node fold %lu, rec fold %lu\n",
(ulong) buf_frame_get_page_no(page),
(ulong)(node->data),
(ulong) ut_dulint_get_high(btr_page_get_index_id(page)),
(ulong) ut_dulint_get_low(btr_page_get_index_id(page)),
(ulong) node->fold,
(ulong) rec_fold((rec_t*)(node->data),
block->curr_n_fields,
block->curr_n_bytes,
btr_page_get_index_id(page)));
"ptr mem address %p index id %lu %lu, node fold %lu, rec fold %lu\n",
(ulong) buf_frame_get_page_no(page),
node->data,
(ulong) ut_dulint_get_high(btr_page_get_index_id(page)),
(ulong) ut_dulint_get_low(btr_page_get_index_id(page)),
(ulong) node->fold,
(ulong) rec_fold((rec_t*)(node->data),
block->curr_n_fields,
block->curr_n_bytes,
btr_page_get_index_id(page)));
rec_sprintf(rec_str, 450, (rec_t*)(node->data));
fprintf(stderr,
"InnoDB: Record %s\n"
"InnoDB: on that page.", rec_str);
fprintf(stderr,
"Page mem address %lu, is hashed %lu, n fields %lu, n bytes %lu\n"
fputs("InnoDB: Record ", stderr);
rec_print(stderr, (rec_t*)(node->data));
fprintf(stderr, "\nInnoDB: on that page."
"Page mem address %p, is hashed %lu, n fields %lu, n bytes %lu\n"
"side %lu\n",
(ulong) page, (ulong) block->is_hashed,
(ulong) block->curr_n_fields,
(ulong) block->curr_n_bytes, (ulong) block->curr_side);
page, (ulong) block->is_hashed,
(ulong) block->curr_n_fields,
(ulong) block->curr_n_bytes, (ulong) block->curr_side);
if (n_page_dumps < 20) {
buf_page_print(page);

View File

@ -223,12 +223,14 @@ in the free list to the frames.
buf_pool_t* buf_pool = NULL; /* The buffer buf_pool of the database */
ulint buf_dbg_counter = 0; /* This is used to insert validation
#ifdef UNIV_DEBUG
static ulint buf_dbg_counter = 0; /* This is used to insert validation
operations in excution in the
debug version */
ibool buf_debug_prints = FALSE; /* If this is set TRUE,
the program prints info whenever
read-ahead or flush occurs */
#endif /* UNIV_DEBUG */
/************************************************************************
Calculates a page checksum which is stored to the page when it is written
@ -372,19 +374,12 @@ buf_page_print(
dict_index_t* index;
ulint checksum;
ulint old_checksum;
char* buf;
buf = mem_alloc(4 * UNIV_PAGE_SIZE);
ut_sprintf_buf(buf, read_buf, UNIV_PAGE_SIZE);
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Page dump in ascii and hex (%lu bytes):\n%s",
(ulong) UNIV_PAGE_SIZE, buf);
fprintf(stderr, "InnoDB: End of page dump\n");
mem_free(buf);
fprintf(stderr, " InnoDB: Page dump in ascii and hex (%lu bytes):\n",
(ulint)UNIV_PAGE_SIZE);
ut_print_buf(stderr, read_buf, UNIV_PAGE_SIZE);
fputs("InnoDB: End of page dump\n", stderr);
checksum = buf_calc_page_new_checksum(read_buf);
old_checksum = buf_calc_page_old_checksum(read_buf);
@ -433,17 +428,16 @@ buf_page_print(
index = dict_index_find_on_id_low(
btr_page_get_index_id(read_buf));
if (index) {
fprintf(stderr,
"InnoDB: and table %s index %s\n",
index->table_name,
index->name);
fputs("InnoDB: (", stderr);
dict_index_name_print(stderr, index);
fputs(")\n", stderr);
}
}
} else if (fil_page_get_type(read_buf) == FIL_PAGE_INODE) {
fprintf(stderr, "InnoDB: Page may be an 'inode' page\n");
fputs("InnoDB: Page may be an 'inode' page\n", stderr);
} else if (fil_page_get_type(read_buf) == FIL_PAGE_IBUF_FREE_LIST) {
fprintf(stderr,
"InnoDB: Page may be an insert buffer free list page\n");
fputs("InnoDB: Page may be an insert buffer free list page\n",
stderr);
}
}
@ -1551,11 +1545,12 @@ buf_page_init(
"InnoDB: Error: page %lu %lu already found from the hash table\n",
(ulong) space,
(ulong) offset);
#ifdef UNIV_DEBUG
buf_print();
buf_LRU_print();
buf_validate();
buf_LRU_validate();
#endif /* UNIV_DEBUG */
ut_a(0);
}
@ -1732,11 +1727,12 @@ buf_page_create(
/* If we get here, the page was not in buf_pool: init it there */
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf("Creating space %lu page %lu to buffer\n",
(ulong) space,
(ulong) offset);
fprintf(stderr, "Creating space %lu page %lu to buffer\n",
(ulong) space, (ulong) offset);
}
#endif /* UNIV_DEBUG */
block = free_block;
@ -1789,8 +1785,6 @@ buf_page_io_complete(
/*=================*/
buf_block_t* block) /* in: pointer to the block in question */
{
dict_index_t* index;
dulint id;
ulint io_type;
ulint read_page_no;
@ -1823,17 +1817,17 @@ buf_page_io_complete(
"InnoDB: Database page corruption on disk or a failed\n"
"InnoDB: file read of page %lu.\n", (ulong) block->offset);
fprintf(stderr,
"InnoDB: You may have to recover from a backup.\n");
fputs(
"InnoDB: You may have to recover from a backup.\n", stderr);
buf_page_print(block->frame);
fprintf(stderr,
"InnoDB: Database page corruption on disk or a failed\n"
"InnoDB: file read of page %lu.\n", (ulong) block->offset);
fprintf(stderr,
"InnoDB: You may have to recover from a backup.\n");
fprintf(stderr,
fputs(
"InnoDB: You may have to recover from a backup.\n", stderr);
fputs(
"InnoDB: It is also possible that your operating\n"
"InnoDB: system has corrupted its own file cache\n"
"InnoDB: and rebooting your computer removes the\n"
@ -1844,12 +1838,13 @@ buf_page_io_complete(
"InnoDB: the corrupt table. You can use CHECK\n"
"InnoDB: TABLE to scan your table for corruption.\n"
"InnoDB: Look also at section 6.1 of\n"
"InnoDB: http://www.innodb.com/ibman.html about\n"
"InnoDB: forcing recovery.\n");
"InnoDB: http://www.innodb.com/ibman.php about\n"
"InnoDB: forcing recovery.\n", stderr);
if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
fprintf(stderr,
"InnoDB: Ending processing because of a corrupt database page.\n");
fputs(
"InnoDB: Ending processing because of a corrupt database page.\n",
stderr);
exit(1);
}
}
@ -1888,9 +1883,11 @@ buf_page_io_complete(
rw_lock_x_unlock_gen(&(block->lock), BUF_IO_READ);
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf("Has read ");
fputs("Has read ", stderr);
}
#endif /* UNIV_DEBUG */
} else {
ut_ad(io_type == BUF_IO_WRITE);
@ -1903,31 +1900,21 @@ buf_page_io_complete(
buf_pool->n_pages_written++;
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf("Has written ");
fputs("Has written ", stderr);
}
#endif /* UNIV_DEBUG */
}
mutex_exit(&(buf_pool->mutex));
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf("page space %lu page no %lu", (ulong) block->space,
(ulong) block->offset);
id = btr_page_get_index_id(block->frame);
index = NULL;
/* The following can cause deadlocks if used: */
/*
index = dict_index_get_if_in_cache(id);
if (index) {
printf(" index name %s table %s", index->name,
index->table->name);
}
*/
printf("\n");
fprintf(stderr, "page space %lu page no %lu\n",
(ulong) block->space, (ulong) block->offset);
}
#endif /* UNIV_DEBUG */
}
/*************************************************************************
@ -1956,6 +1943,7 @@ buf_pool_invalidate(void)
mutex_exit(&(buf_pool->mutex));
}
#ifdef UNIV_DEBUG
/*************************************************************************
Validates the buffer buf_pool data structure. */
@ -2027,16 +2015,14 @@ buf_validate(void)
}
if (n_lru + n_free > buf_pool->curr_size) {
printf("n LRU %lu, n free %lu\n", (ulong) n_lru,
(ulong) n_free);
fprintf(stderr, "n LRU %lu, n free %lu\n", (ulong) n_lru, (ulong) n_free);
ut_error;
}
ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == n_lru);
if (UT_LIST_GET_LEN(buf_pool->free) != n_free) {
printf("Free list len %lu, free blocks %lu\n",
(ulong) UT_LIST_GET_LEN(buf_pool->free),
(ulong) n_free);
fprintf(stderr, "Free list len %lu, free blocks %lu\n",
(ulong) UT_LIST_GET_LEN(buf_pool->free), (ulong) n_free);
ut_error;
}
ut_a(UT_LIST_GET_LEN(buf_pool->flush_list) == n_flush);
@ -2079,23 +2065,24 @@ buf_print(void)
mutex_enter(&(buf_pool->mutex));
printf("buf_pool size %lu \n", (ulong) size);
printf("database pages %lu \n", (ulong) UT_LIST_GET_LEN(buf_pool->LRU));
printf("free pages %lu \n", (ulong) UT_LIST_GET_LEN(buf_pool->free));
printf("modified database pages %lu \n",
(ulong) UT_LIST_GET_LEN(buf_pool->flush_list));
printf("n pending reads %lu \n", (ulong) buf_pool->n_pend_reads);
printf("n pending flush LRU %lu list %lu single page %lu\n",
(ulong) buf_pool->n_flush[BUF_FLUSH_LRU],
(ulong) buf_pool->n_flush[BUF_FLUSH_LIST],
(ulong) buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]);
printf("pages read %lu, created %lu, written %lu\n",
(ulong) buf_pool->n_pages_read,
(ulong) buf_pool->n_pages_created,
(ulong) buf_pool->n_pages_written);
fprintf(stderr,
"buf_pool size %lu\n"
"database pages %lu\n"
"free pages %lu\n"
"modified database pages %lu\n"
"n pending reads %lu\n"
"n pending flush LRU %lu list %lu single page %lu\n"
"pages read %lu, created %lu, written %lu\n",
(ulong) size,
(ulong) UT_LIST_GET_LEN(buf_pool->LRU),
(ulong) UT_LIST_GET_LEN(buf_pool->free),
(ulong) UT_LIST_GET_LEN(buf_pool->flush_list),
(ulong) buf_pool->n_pend_reads,
(ulong) buf_pool->n_flush[BUF_FLUSH_LRU],
(ulong) buf_pool->n_flush[BUF_FLUSH_LIST],
(ulong) buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE],
(ulong) buf_pool->n_pages_read, buf_pool->n_pages_created,
(ulong) buf_pool->n_pages_written);
/* Count the number of blocks belonging to each index in the buffer */
@ -2138,16 +2125,17 @@ buf_print(void)
for (i = 0; i < n_found; i++) {
index = dict_index_get_if_in_cache(index_ids[i]);
printf("Block count for index %lu in buffer is about %lu",
fprintf(stderr,
"Block count for index %lu in buffer is about %lu",
(ulong) ut_dulint_get_low(index_ids[i]),
(ulong) counts[i]);
if (index) {
printf(" index name %s table %s", index->name,
index->table->name);
putc(' ', stderr);
dict_index_name_print(stderr, index);
}
printf("\n");
putc('\n', stderr);
}
mem_free(index_ids);
@ -2155,6 +2143,7 @@ buf_print(void)
ut_a(buf_validate());
}
#endif /* UNIV_DEBUG */
/*************************************************************************
Returns the number of pending buf pool ios. */
@ -2198,57 +2187,42 @@ Prints info of the buffer i/o. */
void
buf_print_io(
/*=========*/
char* buf, /* in/out: buffer where to print */
char* buf_end)/* in: buffer end */
FILE* file) /* in/out: buffer where to print */
{
time_t current_time;
double time_elapsed;
ulint size;
ut_ad(buf_pool);
if (buf_end - buf < 400) {
return;
}
size = buf_pool->curr_size;
mutex_enter(&(buf_pool->mutex));
buf += sprintf(buf,
"Buffer pool size %lu\n", (ulong) size);
buf += sprintf(buf,
"Free buffers %lu\n", (ulong) UT_LIST_GET_LEN(buf_pool->free));
buf += sprintf(buf,
"Database pages %lu\n", (ulong) UT_LIST_GET_LEN(buf_pool->LRU));
/*
buf += sprintf(buf,
"Lock heap buffers %lu\n", (ulong) buf_pool->n_lock_heap_pages);
buf += sprintf(buf,
"Hash index buffers %lu\n", (ulong) buf_pool->n_adaptive_hash_pages);
*/
buf += sprintf(buf,
"Modified db pages %lu\n",
(ulong) UT_LIST_GET_LEN(buf_pool->flush_list));
if (srv_use_awe) {
buf += sprintf(buf,
fprintf(stderr,
"AWE: Buffer pool memory frames %lu\n",
(ulong) buf_pool->n_frames);
buf += sprintf(buf,
fprintf(stderr,
"AWE: Database pages and free buffers mapped in frames %lu\n",
(ulong) UT_LIST_GET_LEN(buf_pool->awe_LRU_free_mapped));
}
buf += sprintf(buf, "Pending reads %lu \n", (ulong) buf_pool->n_pend_reads);
buf += sprintf(buf,
fprintf(file,
"Buffer pool size %lu\n"
"Free buffers %lu\n"
"Database pages %lu\n"
"Modified db pages %lu\n"
"Pending reads %lu\n"
"Pending writes: LRU %lu, flush list %lu, single page %lu\n",
(ulong) (buf_pool->n_flush[BUF_FLUSH_LRU]
+ buf_pool->init_flush[BUF_FLUSH_LRU]),
(ulong) (buf_pool->n_flush[BUF_FLUSH_LIST]
+ buf_pool->init_flush[BUF_FLUSH_LIST]),
(ulong) size,
(ulong) UT_LIST_GET_LEN(buf_pool->free),
(ulong) UT_LIST_GET_LEN(buf_pool->LRU),
(ulong) UT_LIST_GET_LEN(buf_pool->flush_list),
(ulong) buf_pool->n_pend_reads,
(ulong) buf_pool->n_flush[BUF_FLUSH_LRU]
+ buf_pool->init_flush[BUF_FLUSH_LRU],
(ulong) buf_pool->n_flush[BUF_FLUSH_LIST]
+ buf_pool->init_flush[BUF_FLUSH_LIST],
(ulong) buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]);
current_time = time(NULL);
@ -2256,11 +2230,12 @@ buf_print_io(
buf_pool->last_printout_time);
buf_pool->last_printout_time = current_time;
buf += sprintf(buf, "Pages read %lu, created %lu, written %lu\n",
(ulong) buf_pool->n_pages_read,
(ulong) buf_pool->n_pages_created,
(ulong) buf_pool->n_pages_written);
buf += sprintf(buf, "%.2f reads/s, %.2f creates/s, %.2f writes/s\n",
fprintf(file,
"Pages read %lu, created %lu, written %lu\n"
"%.2f reads/s, %.2f creates/s, %.2f writes/s\n",
(ulong) buf_pool->n_pages_read,
(ulong) buf_pool->n_pages_created,
(ulong) buf_pool->n_pages_written,
(buf_pool->n_pages_read - buf_pool->n_pages_read_old)
/ time_elapsed,
(buf_pool->n_pages_created - buf_pool->n_pages_created_old)
@ -2269,21 +2244,21 @@ buf_print_io(
/ time_elapsed);
if (srv_use_awe) {
buf += sprintf(buf, "AWE: %.2f page remaps/s\n",
fprintf(file, "AWE: %.2f page remaps/s\n",
(buf_pool->n_pages_awe_remapped
- buf_pool->n_pages_awe_remapped_old)
/ time_elapsed);
}
if (buf_pool->n_page_gets > buf_pool->n_page_gets_old) {
buf += sprintf(buf, "Buffer pool hit rate %lu / 1000\n",
fprintf(file, "Buffer pool hit rate %lu / 1000\n",
(ulong) (1000
- ((1000 *
(buf_pool->n_pages_read - buf_pool->n_pages_read_old))
/ (buf_pool->n_page_gets - buf_pool->n_page_gets_old))));
} else {
buf += sprintf(buf,
"No buffer pool page gets since the last printout\n");
fputs("No buffer pool page gets since the last printout\n",
file);
}
buf_pool->n_page_gets_old = buf_pool->n_page_gets;
@ -2332,8 +2307,9 @@ buf_all_freed(void)
if (!buf_flush_ready_for_replace(block)) {
/* printf("Page %lu %lu still fixed or dirty\n",
block->space, block->offset); */
fprintf(stderr,
"Page %lu %lu still fixed or dirty\n",
(ulong) block->space, (ulong) block->offset);
ut_error;
}
}

View File

@ -32,6 +32,7 @@ flushed along with the original page. */
#define BUF_FLUSH_AREA ut_min(BUF_READ_AHEAD_AREA,\
buf_pool->curr_size / 16)
#ifdef UNIV_DEBUG
/**********************************************************************
Validates the flush list. */
static
@ -39,6 +40,7 @@ ibool
buf_flush_validate_low(void);
/*========================*/
/* out: TRUE if ok */
#endif /* UNIV_DEBUG */
/************************************************************************
Inserts a modified block into the flush list. */
@ -193,7 +195,7 @@ buf_flush_write_complete(
buf_pool->LRU_flush_ended++;
}
/* printf("n pending flush %lu\n",
/* fprintf(stderr, "n pending flush %lu\n",
buf_pool->n_flush[block->flush_type]); */
if ((buf_pool->n_flush[block->flush_type] == 0)
@ -420,8 +422,8 @@ buf_flush_write_block_low(
ut_ad(!ut_dulint_is_zero(block->newest_modification));
#ifdef UNIV_LOG_DEBUG
printf(
"Warning: cannot force log to disk in the log debug version!\n");
fputs("Warning: cannot force log to disk in the log debug version!\n",
stderr);
#else
/* Force the log to the disk before writing the modified block */
log_write_up_to(block->newest_modification, LOG_WAIT_ALL_GROUPS, TRUE);
@ -511,11 +513,13 @@ buf_flush_try_page(
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
}
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf("Flushing page space %lu, page no %lu \n",
(ulong) block->space,
(ulong) block->offset);
fprintf(stderr,
"Flushing page space %lu, page no %lu \n",
(ulong) block->space, (ulong) block->offset);
}
#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block);
@ -599,12 +603,14 @@ buf_flush_try_page(
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf(
fprintf(stderr,
"Flushing single page space %lu, page no %lu \n",
(ulong) block->space,
(ulong) block->offset);
}
#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block);
@ -645,7 +651,7 @@ buf_flush_try_neighbors(
high = offset + 1;
}
/* printf("Flush area: low %lu high %lu\n", low, high); */
/* fprintf(stderr, "Flush area: low %lu high %lu\n", low, high); */
if (high > fil_space_get_size(space)) {
high = fil_space_get_size(space);
@ -793,7 +799,7 @@ buf_flush_batch(
page_count +=
buf_flush_try_neighbors(space, offset,
flush_type);
/* printf(
/* fprintf(stderr,
"Flush type %lu, page no %lu, neighb %lu\n",
flush_type, offset,
page_count - old_page_count); */
@ -831,17 +837,16 @@ buf_flush_batch(
buf_flush_buffered_writes();
#ifdef UNIV_DEBUG
if (buf_debug_prints && page_count > 0) {
if (flush_type == BUF_FLUSH_LRU) {
printf("Flushed %lu pages in LRU flush\n",
(ulong) page_count);
} else if (flush_type == BUF_FLUSH_LIST) {
printf("Flushed %lu pages in flush list flush\n",
(ulong) page_count);
} else {
ut_error;
}
ut_a(flush_type == BUF_FLUSH_LRU
|| flush_type == BUF_FLUSH_LIST);
fprintf(stderr, flush_type == BUF_FLUSH_LRU
? "Flushed %lu pages in LRU flush\n"
: "Flushed %lu pages in flush list flush\n",
(ulong) page_count);
}
#endif /* UNIV_DEBUG */
return(page_count);
}
@ -933,6 +938,7 @@ buf_flush_free_margin(void)
}
}
#ifdef UNIV_DEBUG
/**********************************************************************
Validates the flush list. */
static
@ -982,3 +988,4 @@ buf_flush_validate(void)
return(ret);
}
#endif /* UNIV_DEBUG */

View File

@ -97,13 +97,14 @@ scan_again:
}
if (block->space == id) {
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf(
"Dropping space %lu page %lu\n",
(ulong) block->space,
(ulong) block->offset);
}
#endif
if (block->is_hashed) {
page_no = block->offset;
@ -207,12 +208,16 @@ buf_LRU_search_and_free_block(
while (block != NULL) {
ut_a(block->in_LRU_list);
if (buf_flush_ready_for_replace(block)) {
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf(
fprintf(stderr,
"Putting space %lu page %lu to free list\n",
(ulong) block->space,
(ulong) block->offset);
}
#endif /* UNIV_DEBUG */
buf_LRU_block_remove_hashed_page(block);
mutex_exit(&(buf_pool->mutex));
@ -404,28 +409,21 @@ loop:
fprintf(stderr,
"InnoDB: Warning: difficult to find free blocks from\n"
"InnoDB: the buffer pool (%lu search iterations)! Consider\n"
"InnoDB: increasing the buffer pool size.\n",
(ulong) n_iterations);
fprintf(stderr,
"InnoDB: increasing the buffer pool size.\n"
"InnoDB: It is also possible that in your Unix version\n"
"InnoDB: fsync is very slow, or completely frozen inside\n"
"InnoDB: the OS kernel. Then upgrading to a newer version\n"
"InnoDB: of your operating system may help. Look at the\n"
"InnoDB: number of fsyncs in diagnostic info below.\n");
fprintf(stderr,
"InnoDB: Pending flushes (fsync) log: %lu; buffer pool: %lu\n",
(ulong) fil_n_pending_log_flushes,
(ulong) fil_n_pending_tablespace_flushes);
fprintf(stderr,
"InnoDB: %lu OS file reads, %lu OS file writes, %lu OS fsyncs\n",
(ulong) os_n_file_reads,
(ulong) os_n_file_writes,
(ulong) os_n_fsyncs);
fprintf(stderr,
"InnoDB: number of fsyncs in diagnostic info below.\n"
"InnoDB: Pending flushes (fsync) log: %lu; buffer pool: %lu\n"
"InnoDB: %lu OS file reads, %lu OS file writes, %lu OS fsyncs\n"
"InnoDB: Starting InnoDB Monitor to print further\n"
"InnoDB: diagnostics to the standard output.\n");
"InnoDB: diagnostics to the standard output.\n",
(ulong) n_iterations,
(ulong) fil_n_pending_log_flushes,
(ulong) fil_n_pending_tablespace_flushes,
(ulong) os_n_file_reads, (ulong) os_n_file_writes,
(ulong) os_n_fsyncs);
mon_value_was = srv_print_innodb_monitor;
started_monitor = TRUE;
@ -855,11 +853,12 @@ buf_LRU_block_remove_hashed_page(
(ulong) block);
}
#ifdef UNIV_DEBUG
buf_print();
buf_LRU_print();
buf_validate();
buf_LRU_validate();
#endif
ut_a(0);
}
@ -889,6 +888,7 @@ buf_LRU_block_free_hashed_page(
buf_LRU_block_free_non_file_page(block);
}
#ifdef UNIV_DEBUG
/**************************************************************************
Validates the LRU list. */
@ -975,7 +975,7 @@ buf_LRU_print(void)
ut_ad(buf_pool);
mutex_enter(&(buf_pool->mutex));
printf("Pool ulint clock %lu\n", (ulong) buf_pool->ulint_clock);
fprintf(stderr, "Pool ulint clock %lu\n", (ulong) buf_pool->ulint_clock);
block = UT_LIST_GET_FIRST(buf_pool->LRU);
@ -983,39 +983,40 @@ buf_LRU_print(void)
while (block != NULL) {
printf("BLOCK %lu ", (ulong) block->offset);
fprintf(stderr, "BLOCK %lu ", (ulong) block->offset);
if (block->old) {
printf("old ");
fputs("old ", stderr);
}
if (block->buf_fix_count) {
printf("buffix count %lu ", (ulong) block->buf_fix_count);
fprintf(stderr, "buffix count %lu ",
(ulong) block->buf_fix_count);
}
if (block->io_fix) {
printf("io_fix %lu ", (ulong) block->io_fix);
fprintf(stderr, "io_fix %lu ", (ulong) block->io_fix);
}
if (ut_dulint_cmp(block->oldest_modification,
ut_dulint_zero) > 0) {
printf("modif. ");
fputs("modif. ", stderr);
}
printf("LRU pos %lu ", (ulong) block->LRU_position);
frame = buf_block_get_frame(block);
printf("type %lu ", (ulong) fil_page_get_type(frame));
printf("index id %lu ", (ulong) ut_dulint_get_low(
btr_page_get_index_id(frame)));
fprintf(stderr, "LRU pos %lu type %lu index id %lu ",
(ulong) block->LRU_position,
(ulong) fil_page_get_type(frame),
(ulong) ut_dulint_get_low(btr_page_get_index_id(frame)));
block = UT_LIST_GET_NEXT(LRU, block);
len++;
if (len % 10 == 0) {
printf("\n");
if (++len == 10) {
len = 0;
putc('\n', stderr);
}
}
mutex_exit(&(buf_pool->mutex));
}
#endif /* UNIV_DEBUG */

View File

@ -97,7 +97,8 @@ buf_read_page_low(
log mutex: the read must be handled before other reads
which might incur ibuf operations and thus write to the log */
printf("Log debug: reading replicate page in sync mode\n");
fputs("Log debug: reading replicate page in sync mode\n",
stderr);
sync = TRUE;
}
@ -117,7 +118,6 @@ buf_read_page_low(
or is being dropped; if we succeed in initing the page in the buffer
pool for read, then DISCARD cannot proceed until the read has
completed */
block = buf_page_init_for_read(err, mode, space, tablespace_version,
offset);
if (block == NULL) {
@ -125,11 +125,14 @@ buf_read_page_low(
return(0);
}
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf("Posting read request for page %lu, sync %lu\n",
fprintf(stderr,
"Posting read request for page %lu, sync %lu\n",
(ulong) offset,
(ulong) sync);
}
#endif
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
@ -281,12 +284,14 @@ buf_read_ahead_random(
os_aio_simulated_wake_handler_threads();
#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) {
printf("Random read-ahead space %lu offset %lu pages %lu\n",
fprintf(stderr,
"Random read-ahead space %lu offset %lu pages %lu\n",
(ulong) space, (ulong) offset,
(ulong) count);
}
#endif /* UNIV_DEBUG */
return(count);
}
@ -566,11 +571,13 @@ buf_read_ahead_linear(
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) {
printf(
fprintf(stderr,
"LINEAR read-ahead space %lu offset %lu pages %lu\n",
(ulong) space, (ulong) offset, (ulong) count);
}
#endif /* UNIV_DEBUG */
return(count);
}
@ -629,9 +636,13 @@ buf_read_ibuf_merge_pages(
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf("Ibuf merge read-ahead pages %lu\n", (ulong) n_stored);
fprintf(stderr,
"Ibuf merge read-ahead space %lu pages %lu\n",
(ulong) space, (ulong) n_stored);
}
#endif /* UNIV_DEBUG */
}
/************************************************************************
@ -695,8 +706,10 @@ buf_read_recv_pages(
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf("Recovery applies read-ahead pages %lu\n",
(ulong) n_stored);
fprintf(stderr,
"Recovery applies read-ahead pages %lu\n", (ulong) n_stored);
}
#endif /* UNIV_DEBUG */
}

View File

@ -12,7 +12,6 @@ Created 5/30/1994 Heikki Tuuri
#include "data0data.ic"
#endif
#include "ut0rnd.h"
#include "rem0rec.h"
#include "rem0cmp.h"
#include "page0page.h"
@ -22,12 +21,10 @@ Created 5/30/1994 Heikki Tuuri
byte data_error; /* data pointers of tuple fields are initialized
to point here for error checking */
#ifdef UNIV_DEBUG
ulint data_dummy; /* this is used to fool the compiler in
dtuple_validate */
byte data_buf[8192]; /* used in generating test tuples */
ulint data_rnd = 756511;
#endif /* UNIV_DEBUG */
/* Some non-inlined functions used in the MySQL interface: */
void
@ -215,16 +212,15 @@ dtuple_check_typed_no_assert(
{
dfield_t* field;
ulint i;
char err_buf[1000];
if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) {
fprintf(stderr,
"InnoDB: Error: index entry has %lu fields\n",
(ulong) dtuple_get_n_fields(tuple));
dtuple_sprintf(err_buf, 900, tuple);
fprintf(stderr,
"InnoDB: Tuple contents: %s\n", err_buf);
dump:
fputs("InnoDB: Tuple contents: ", stderr);
dtuple_print(stderr, tuple);
putc('\n', stderr);
return(FALSE);
}
@ -234,12 +230,7 @@ dtuple_check_typed_no_assert(
field = dtuple_get_nth_field(tuple, i);
if (!dfield_check_typed_no_assert(field)) {
dtuple_sprintf(err_buf, 900, tuple);
fprintf(stderr,
"InnoDB: Tuple contents: %s\n", err_buf);
return(FALSE);
goto dump;
}
}
@ -291,6 +282,7 @@ dtuple_check_typed(
return(TRUE);
}
#ifdef UNIV_DEBUG
/**************************************************************
Validates the consistency of a tuple which must be complete, i.e,
all fields must have been set. */
@ -338,6 +330,7 @@ dtuple_validate(
return(TRUE);
}
#endif /* UNIV_DEBUG */
/*****************************************************************
Pretty prints a dfield value according to its data type. */
@ -356,7 +349,7 @@ dfield_print(
data = dfield_get_data(dfield);
if (len == UNIV_SQL_NULL) {
printf("NULL");
fputs("NULL", stderr);
return;
}
@ -366,18 +359,12 @@ dfield_print(
if ((mtype == DATA_CHAR) || (mtype == DATA_VARCHAR)) {
for (i = 0; i < len; i++) {
if (isprint((char)(*data))) {
printf("%c", (char)*data);
} else {
printf(" ");
}
data++;
int c = *data++;
putc(isprint(c) ? c : ' ', stderr);
}
} else if (mtype == DATA_INT) {
ut_a(len == 4); /* only works for 32-bit integers */
printf("%i", (int)mach_read_from_4(data));
fprintf(stderr, "%d", (int)mach_read_from_4(data));
} else {
ut_error;
}
@ -402,7 +389,7 @@ dfield_print_also_hex(
data = dfield_get_data(dfield);
if (len == UNIV_SQL_NULL) {
printf("NULL");
fputs("NULL", stderr);
return;
}
@ -414,15 +401,12 @@ dfield_print_also_hex(
print_also_hex = FALSE;
for (i = 0; i < len; i++) {
if (isprint((char)(*data))) {
printf("%c", (char)*data);
} else {
int c = *data++;
if (!isprint(c)) {
print_also_hex = TRUE;
printf(" ");
c = ' ';
}
data++;
putc(c, stderr);
}
if (!print_also_hex) {
@ -430,18 +414,18 @@ dfield_print_also_hex(
return;
}
printf(" Hex: ");
fputs(" Hex: ", stderr);
data = dfield_get_data(dfield);
for (i = 0; i < len; i++) {
printf("%02lx", (ulong)*data);
fprintf(stderr, "%02lx", (ulint)*data);
data++;
}
} else if (mtype == DATA_INT) {
ut_a(len == 4); /* inly works for 32-bit integers */
printf("%i", (int)mach_read_from_4(data));
ut_a(len == 4); /* only works for 32-bit integers */
fprintf(stderr, "%d", (int)mach_read_from_4(data));
} else {
ut_error;
}
@ -453,6 +437,7 @@ The following function prints the contents of a tuple. */
void
dtuple_print(
/*=========*/
FILE* f, /* in: output stream */
dtuple_t* tuple) /* in: tuple */
{
dfield_t* field;
@ -461,73 +446,24 @@ dtuple_print(
n_fields = dtuple_get_n_fields(tuple);
printf("DATA TUPLE: %lu fields;\n", (ulong) n_fields);
fprintf(f, "DATA TUPLE: %lu fields;\n", (ulong) n_fields);
for (i = 0; i < n_fields; i++) {
printf(" %lu:", (ulong) i);
fprintf(f, " %lu:", (ulong) i);
field = dtuple_get_nth_field(tuple, i);
if (field->len != UNIV_SQL_NULL) {
ut_print_buf(field->data, field->len);
ut_print_buf(f, field->data, field->len);
} else {
printf(" SQL NULL");
fputs(" SQL NULL", f);
}
printf(";");
putc(';', f);
}
printf("\n");
dtuple_validate(tuple);
}
/**************************************************************
The following function prints the contents of a tuple to a buffer. */
ulint
dtuple_sprintf(
/*===========*/
/* out: printed length in bytes */
char* buf, /* in: print buffer */
ulint buf_len,/* in: buf length in bytes */
dtuple_t* tuple) /* in: tuple */
{
dfield_t* field;
ulint n_fields;
ulint len;
ulint i;
len = 0;
n_fields = dtuple_get_n_fields(tuple);
for (i = 0; i < n_fields; i++) {
if (len + 30 > buf_len) {
return(len);
}
len += sprintf(buf + len, " %lu:", (ulong) i);
field = dtuple_get_nth_field(tuple, i);
if (field->len != UNIV_SQL_NULL) {
if (5 * field->len + len + 30 > buf_len) {
return(len);
}
len += ut_sprintf_buf(buf + len, field->data,
field->len);
} else {
len += sprintf(buf + len, " SQL NULL");
}
len += sprintf(buf + len, ";");
}
return(len);
putc('\n', f);
ut_ad(dtuple_validate(tuple));
}
/******************************************************************
@ -561,7 +497,6 @@ dtuple_convert_big_rec(
ibool is_externally_stored;
ulint i;
ulint j;
char err_buf[1000];
ut_a(dtuple_check_typed_no_assert(entry));
@ -570,10 +505,9 @@ dtuple_convert_big_rec(
if (size > 1000000000) {
fprintf(stderr,
"InnoDB: Warning: tuple size very big: %lu\n", (ulong) size);
dtuple_sprintf(err_buf, 900, entry);
fprintf(stderr,
"InnoDB: Tuple contents: %s\n", err_buf);
fputs("InnoDB: Tuple contents: ", stderr);
dtuple_print(stderr, entry);
putc('\n', stderr);
}
heap = mem_heap_create(size + dtuple_get_n_fields(entry)

View File

@ -104,6 +104,7 @@ dtype_form_prtype(
return(old_prtype + (charset_coll << 16));
}
#ifdef UNIV_DEBUG
/*************************************************************************
Validates a data type structure. */
@ -122,6 +123,7 @@ dtype_validate(
return(TRUE);
}
#endif /* UNIV_DEBUG */
/*************************************************************************
Prints a data type structure. */
@ -140,19 +142,19 @@ dtype_print(
mtype = type->mtype;
prtype = type->prtype;
if (mtype == DATA_VARCHAR) {
printf("DATA_VARCHAR");
fputs("DATA_VARCHAR", stderr);
} else if (mtype == DATA_CHAR) {
printf("DATA_CHAR");
fputs("DATA_CHAR", stderr);
} else if (mtype == DATA_BINARY) {
printf("DATA_BINARY");
fputs("DATA_BINARY", stderr);
} else if (mtype == DATA_INT) {
printf("DATA_INT");
fputs("DATA_INT", stderr);
} else if (mtype == DATA_MYSQL) {
printf("DATA_MYSQL");
fputs("DATA_MYSQL", stderr);
} else if (mtype == DATA_SYS) {
printf("DATA_SYS");
fputs("DATA_SYS", stderr);
} else {
printf("type %lu", (ulong) mtype);
fprintf(stderr, "type %lu", (ulong) mtype);
}
len = type->len;
@ -160,24 +162,24 @@ dtype_print(
if ((type->mtype == DATA_SYS)
|| (type->mtype == DATA_VARCHAR)
|| (type->mtype == DATA_CHAR)) {
printf(" ");
putc(' ', stderr);
if (prtype == DATA_ROW_ID) {
printf("DATA_ROW_ID");
fputs("DATA_ROW_ID", stderr);
len = DATA_ROW_ID_LEN;
} else if (prtype == DATA_ROLL_PTR) {
printf("DATA_ROLL_PTR");
fputs("DATA_ROLL_PTR", stderr);
len = DATA_ROLL_PTR_LEN;
} else if (prtype == DATA_TRX_ID) {
printf("DATA_TRX_ID");
fputs("DATA_TRX_ID", stderr);
len = DATA_TRX_ID_LEN;
} else if (prtype == DATA_MIX_ID) {
printf("DATA_MIX_ID");
fputs("DATA_MIX_ID", stderr);
} else if (prtype == DATA_ENGLISH) {
printf("DATA_ENGLISH");
fputs("DATA_ENGLISH", stderr);
} else {
printf("prtype %lu", (ulong) mtype);
fprintf(stderr, "prtype %lu", (ulong) mtype);
}
}
printf(" len %lu prec %lu", (ulong) len, (ulong) type->prec);
fprintf(stderr, " len %lu prec %lu", (ulong) len, (ulong) type->prec);
}

View File

@ -71,7 +71,8 @@ dict_hdr_get_new_id(
compile wrong */
if (0 == ut_dulint_cmp(id, ut_dulint_max)) {
printf("Max id\n");
/* TO DO: remove this code, or make it conditional */
ut_dbg_null_ptr = 0;
}
id = ut_dulint_add(id, 1);

View File

@ -25,11 +25,6 @@ Created 1/8/1996 Heikki Tuuri
#include "trx0roll.h"
#include "usr0sess.h"
/* Maximum lengths of identifiers in MySQL, in bytes */
#define MAX_TABLE_NAME_LEN 64
#define MAX_COLUMN_NAME_LEN 64
#define MAX_IDENTIFIER_LEN 255
/*********************************************************************
Based on a table object, this function builds the entry to be inserted
in the SYS_TABLES system table. */
@ -37,67 +32,6 @@ static
dtuple_t*
dict_create_sys_tables_tuple(
/*=========================*/
/* out: the tuple which should be inserted */
dict_table_t* table, /* in: table */
mem_heap_t* heap); /* in: memory heap from which the memory for
the built tuple is allocated */
/*********************************************************************
Based on a table object, this function builds the entry to be inserted
in the SYS_COLUMNS system table. */
static
dtuple_t*
dict_create_sys_columns_tuple(
/*==========================*/
/* out: the tuple which should be inserted */
dict_table_t* table, /* in: table */
ulint i, /* in: column number */
mem_heap_t* heap); /* in: memory heap from which the memory for
the built tuple is allocated */
/*********************************************************************
Based on an index object, this function builds the entry to be inserted
in the SYS_INDEXES system table. */
static
dtuple_t*
dict_create_sys_indexes_tuple(
/*==========================*/
/* out: the tuple which should be inserted */
dict_index_t* index, /* in: index */
mem_heap_t* heap, /* in: memory heap from which the memory for
the built tuple is allocated */
trx_t* trx); /* in: transaction handle */
/*********************************************************************
Based on an index object, this function builds the entry to be inserted
in the SYS_FIELDS system table. */
static
dtuple_t*
dict_create_sys_fields_tuple(
/*=========================*/
/* out: the tuple which should be inserted */
dict_index_t* index, /* in: index */
ulint i, /* in: field number */
mem_heap_t* heap); /* in: memory heap from which the memory for
the built tuple is allocated */
/*********************************************************************
Creates the tuple with which the index entry is searched for
writing the index tree root page number, if such a tree is created. */
static
dtuple_t*
dict_create_search_tuple(
/*=====================*/
/* out: the tuple for search */
dtuple_t* tuple, /* in: the tuple inserted in the SYS_INDEXES
table */
mem_heap_t* heap); /* in: memory heap from which the memory for
the built tuple is allocated */
/*********************************************************************
Based on a table object, this function builds the entry to be inserted
in the SYS_TABLES system table. */
static
dtuple_t*
dict_create_sys_tables_tuple(
/*=========================*/
/* out: the tuple which should be inserted */
dict_table_t* table, /* in: table */
mem_heap_t* heap) /* in: memory heap from which the memory for
the built tuple is allocated */
@ -359,9 +293,8 @@ dict_create_sys_indexes_tuple(
/*==========================*/
/* out: the tuple which should be inserted */
dict_index_t* index, /* in: index */
mem_heap_t* heap, /* in: memory heap from which the memory for
mem_heap_t* heap) /* in: memory heap from which the memory for
the built tuple is allocated */
trx_t* trx) /* in: transaction handle */
{
dict_table_t* sys_indexes;
dict_table_t* table;
@ -369,7 +302,6 @@ dict_create_sys_indexes_tuple(
dfield_t* dfield;
byte* ptr;
UT_NOT_USED(trx);
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
@ -415,7 +347,9 @@ dict_create_sys_indexes_tuple(
dfield_set_data(dfield, ptr, 4);
/* 7: SPACE --------------------------*/
ut_a(DICT_SYS_INDEXES_SPACE_NO_FIELD == 7);
#if DICT_SYS_INDEXES_SPACE_NO_FIELD != 7
#error "DICT_SYS_INDEXES_SPACE_NO_FIELD != 7"
#endif
dfield = dtuple_get_nth_field(entry, 5);
@ -425,7 +359,9 @@ dict_create_sys_indexes_tuple(
dfield_set_data(dfield, ptr, 4);
/* 8: PAGE_NO --------------------------*/
ut_a(DICT_SYS_INDEXES_PAGE_NO_FIELD == 8);
#if DICT_SYS_INDEXES_PAGE_NO_FIELD != 8
#error "DICT_SYS_INDEXES_PAGE_NO_FIELD != 8"
#endif
dfield = dtuple_get_nth_field(entry, 6);
@ -593,8 +529,7 @@ dict_build_index_def_step(
index->page_no = FIL_NULL;
row = dict_create_sys_indexes_tuple(index, node->heap,
thr_get_trx(thr));
row = dict_create_sys_indexes_tuple(index, node->heap);
node->ind_row = row;
ins_node_set_new_row(node->ind_def, row);
@ -630,7 +565,6 @@ ulint
dict_create_index_tree_step(
/*========================*/
/* out: DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
que_thr_t* thr, /* in: query thread */
ind_node_t* node) /* in: index create node */
{
dict_index_t* index;
@ -643,7 +577,6 @@ dict_create_index_tree_step(
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
UT_NOT_USED(thr);
index = node->index;
table = node->table;
@ -1003,7 +936,7 @@ dict_create_index_step(
if (node->state == INDEX_CREATE_INDEX_TREE) {
err = dict_create_index_tree_step(thr, node);
err = dict_create_index_tree_step(node);
if (err != DB_SUCCESS) {
@ -1101,13 +1034,13 @@ dict_create_or_check_foreign_constraint_tables(void)
if (table1) {
fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN table\n");
row_drop_table_for_mysql((char *) "SYS_FOREIGN", trx);
row_drop_table_for_mysql((char*)"SYS_FOREIGN", trx, TRUE);
}
if (table2) {
fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN_COLS table\n");
row_drop_table_for_mysql((char *) "SYS_FOREIGN_COLS", trx);
row_drop_table_for_mysql((char*)"SYS_FOREIGN_COLS", trx, TRUE);
}
fprintf(stderr,
@ -1157,8 +1090,8 @@ dict_create_or_check_foreign_constraint_tables(void)
fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN tables\n");
row_drop_table_for_mysql((char *) "SYS_FOREIGN", trx);
row_drop_table_for_mysql((char *) "SYS_FOREIGN_COLS", trx);
row_drop_table_for_mysql((char*)"SYS_FOREIGN", trx, TRUE);
row_drop_table_for_mysql((char*)"SYS_FOREIGN_COLS", trx, TRUE);
error = DB_MUST_GET_MORE_FILE_SPACE;
}
@ -1207,11 +1140,22 @@ dict_create_add_foreigns_to_dictionary(
que_t* graph;
ulint number = start_id + 1;
ulint len;
ulint namelen;
ulint error;
char* ebuf = dict_foreign_err_buf;
FILE* ef = dict_foreign_err_file;
ulint i;
char buf[10000];
char* sql;
char* sqlend;
/* This procedure builds an InnoDB stored procedure which will insert
the necessary rows into SYS_FOREIGN and SYS_FOREIGN_COLS. */
static const char str1[] = "PROCEDURE ADD_FOREIGN_DEFS_PROC () IS\n"
"BEGIN\n"
"INSERT INTO SYS_FOREIGN VALUES(";
static const char str2[] = ");\n";
static const char str3[] =
"INSERT INTO SYS_FOREIGN_COLS VALUES(";
static const char str4[] =
"COMMIT WORK;\n"
"END;\n";
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
@ -1231,58 +1175,75 @@ loop:
return(DB_SUCCESS);
}
/* Build an InnoDB stored procedure which will insert the necessary
rows to SYS_FOREIGN and SYS_FOREIGN_COLS */
len = 0;
len += sprintf(buf,
"PROCEDURE ADD_FOREIGN_DEFS_PROC () IS\n"
"BEGIN\n");
namelen = strlen(table->name);
ut_a(namelen < MAX_TABLE_NAME_LEN);
if (foreign->id == NULL) {
/* Generate a new constraint id */
foreign->id = mem_heap_alloc(foreign->heap, namelen + 20);
ulint namelen = strlen(table->name);
char* id = mem_heap_alloc(foreign->heap, namelen + 20);
/* no overflow if number < 1e13 */
sprintf(foreign->id, "%s_ibfk_%lu", table->name, (ulong) number);
number++;
sprintf(id, "%s_ibfk_%lu", table->name, (ulong) number++);
foreign->id = id;
}
ut_a(strlen(foreign->id) < MAX_IDENTIFIER_LEN);
ut_a(len < (sizeof buf)
- 46 - 2 * MAX_TABLE_NAME_LEN - MAX_IDENTIFIER_LEN - 20);
len += sprintf(buf + len,
"INSERT INTO SYS_FOREIGN VALUES('%s', '%s', '%s', %lu);\n",
foreign->id,
table->name,
foreign->referenced_table_name,
(ulong) (foreign->n_fields
+ (foreign->type << 24)));
len = (sizeof str1) + (sizeof str2) + (sizeof str4) - 3
+ 9/* ' and , chars */ + 10/* 32-bit integer */
+ ut_strlenq(foreign->id, '\'') * (foreign->n_fields + 1)
+ ut_strlenq(table->name, '\'')
+ ut_strlenq(foreign->referenced_table_name, '\'');
for (i = 0; i < foreign->n_fields; i++) {
ut_a(len < (sizeof buf)
- 51 - 2 * MAX_COLUMN_NAME_LEN
- MAX_IDENTIFIER_LEN - 20);
len += sprintf(buf + len,
"INSERT INTO SYS_FOREIGN_COLS VALUES('%s', %lu, '%s', '%s');\n",
foreign->id,
(ulong) i,
foreign->foreign_col_names[i],
foreign->referenced_col_names[i]);
len += 9/* ' and , chars */ + 10/* 32-bit integer */
+ (sizeof str3) + (sizeof str2) - 2
+ ut_strlenq(foreign->foreign_col_names[i], '\'')
+ ut_strlenq(foreign->referenced_col_names[i], '\'');
}
ut_a(len < (sizeof buf) - 19);
len += sprintf(buf + len,"COMMIT WORK;\nEND;\n");
sql = sqlend = mem_alloc(len + 1);
graph = pars_sql(buf);
/* INSERT INTO SYS_FOREIGN VALUES(...); */
memcpy(sqlend, str1, (sizeof str1) - 1);
sqlend += (sizeof str1) - 1;
*sqlend++ = '\'';
sqlend = ut_strcpyq(sqlend, '\'', foreign->id);
*sqlend++ = '\'', *sqlend++ = ',', *sqlend++ = '\'';
sqlend = ut_strcpyq(sqlend, '\'', table->name);
*sqlend++ = '\'', *sqlend++ = ',', *sqlend++ = '\'';
sqlend = ut_strcpyq(sqlend, '\'', foreign->referenced_table_name);
*sqlend++ = '\'', *sqlend++ = ',';
sqlend += sprintf(sqlend, "%010lu",
foreign->n_fields + (foreign->type << 24));
memcpy(sqlend, str2, (sizeof str2) - 1);
sqlend += (sizeof str2) - 1;
for (i = 0; i < foreign->n_fields; i++) {
/* INSERT INTO SYS_FOREIGN_COLS VALUES(...); */
memcpy(sqlend, str3, (sizeof str3) - 1);
sqlend += (sizeof str3) - 1;
*sqlend++ = '\'';
sqlend = ut_strcpyq(sqlend, '\'', foreign->id);
*sqlend++ = '\''; *sqlend++ = ',';
sqlend += sprintf(sqlend, "%010lu", (ulong) i);
*sqlend++ = ','; *sqlend++ = '\'';
sqlend = ut_strcpyq(sqlend, '\'',
foreign->foreign_col_names[i]);
*sqlend++ = '\''; *sqlend++ = ','; *sqlend++ = '\'';
sqlend = ut_strcpyq(sqlend, '\'',
foreign->referenced_col_names[i]);
*sqlend++ = '\'';
memcpy(sqlend, str2, (sizeof str2) - 1);
sqlend += (sizeof str2) - 1;
}
memcpy(sqlend, str4, sizeof str4);
sqlend += sizeof str4;
ut_a(sqlend == sql + len + 1);
graph = pars_sql(sql);
ut_a(graph);
mem_free(sql);
graph->trx = trx;
trx->graph = NULL;
@ -1298,14 +1259,17 @@ loop:
if (error == DB_DUPLICATE_KEY) {
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(ebuf);
ut_a(strlen(ebuf) < DICT_FOREIGN_ERR_BUF_LEN
- MAX_TABLE_NAME_LEN - MAX_IDENTIFIER_LEN - 201);
sprintf(ebuf + strlen(ebuf),
" Error in foreign key constraint creation for table %s.\n"
"A foreign key constraint of name %s\n"
"already exists (note that internally InnoDB adds 'databasename/'\n"
"in front of the user-defined constraint name).\n", table->name, foreign->id);
rewind(ef);
ut_print_timestamp(ef);
fputs(" Error in foreign key constraint creation for table ",
ef);
ut_print_name(ef, table->name);
fputs(".\nA foreign key constraint of name ", ef);
ut_print_name(ef, foreign->id);
fputs("\nalready exists."
" (Note that internally InnoDB adds 'databasename/'\n"
"in front of the user-defined constraint name).\n",
ef);
mutex_exit(&dict_foreign_err_mutex);
@ -1318,12 +1282,12 @@ loop:
"InnoDB: internal error number %lu\n", (ulong) error);
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(ebuf);
ut_a(strlen(ebuf) < DICT_FOREIGN_ERR_BUF_LEN
- MAX_TABLE_NAME_LEN - 124);
sprintf(ebuf + strlen(ebuf),
" Internal error in foreign key constraint creation for table %s.\n"
"See the MySQL .err log in the datadir for more information.\n", table->name);
ut_print_timestamp(ef);
fputs(" Internal error in foreign key constraint creation"
" for table ", ef);
ut_print_name(ef, table->name);
fputs(".\n"
"See the MySQL .err log in the datadir for more information.\n", ef);
mutex_exit(&dict_foreign_err_mutex);
return(error);

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,6 @@ dict_get_first_table_name_in_db(
rec_t* rec;
byte* field;
ulint len;
char* table_name;
mtr_t mtr;
#ifdef UNIV_SYNC_DEBUG
@ -92,9 +91,7 @@ loop:
/* We found one */
table_name = mem_alloc(len + 1);
ut_memcpy(table_name, field, len);
table_name[len] = '\0';
char* table_name = mem_strdupl(field, len);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@ -124,7 +121,6 @@ dict_print(void)
byte* field;
ulint len;
mtr_t mtr;
char table_name[10000];
mutex_enter(&(dict_sys->mutex));
@ -157,18 +153,19 @@ loop:
/* We found one */
ut_memcpy(table_name, field, len);
table_name[len] = '\0';
char* table_name = mem_strdupl(field, len);
btr_pcur_store_position(&pcur, &mtr);
mtr_commit(&mtr);
table = dict_table_get_low(table_name);
mem_free(table_name);
if (table == NULL) {
fprintf(stderr, "InnoDB: Failed to load table %s\n",
table_name);
fputs("InnoDB: Failed to load table ", stderr);
ut_print_namel(stderr, field, len);
putc('\n', stderr);
} else {
/* The table definition was corrupt if there
is no index */
@ -300,7 +297,6 @@ dict_load_columns(
byte* field;
ulint len;
byte* buf;
char* name_buf;
char* name;
ulint mtype;
ulint prtype;
@ -351,12 +347,7 @@ dict_load_columns(
dict_table_get_first_index(sys_columns), 4))->name));
field = rec_get_nth_field(rec, 4, &len);
name_buf = mem_heap_alloc(heap, len + 1);
ut_memcpy(name_buf, field, len);
name_buf[len] = '\0';
name = name_buf;
name = mem_heap_strdupl(heap, field, len);
field = rec_get_nth_field(rec, 5, &len);
mtype = mach_read_from_4(field);
@ -393,6 +384,27 @@ dict_load_columns(
mtr_commit(&mtr);
}
/************************************************************************
Report that an index field or index for a table has been delete marked. */
static
void
dict_load_report_deleted_index(
char* name, /* in: table name */
ulint field) /* in: index field, or ULINT_UNDEFINED */
{
fputs("InnoDB: Error: data dictionary entry"
" for table ", stderr);
ut_print_name(stderr, name);
fputs(" is corrupt!\n", stderr);
if (field != ULINT_UNDEFINED) {
fprintf(stderr,
"InnoDB: Index field %lu is delete marked.\n", field);
}
else {
fputs("InnoDB: An index is delete marked.\n", stderr);
}
}
/************************************************************************
Loads definitions for index fields. */
static
@ -408,7 +420,6 @@ dict_load_fields(
btr_pcur_t pcur;
dtuple_t* tuple;
dfield_t* dfield;
char* col_name;
ulint pos_and_prefix_len;
ulint prefix_len;
rec_t* rec;
@ -446,10 +457,7 @@ dict_load_fields(
ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr));
if (rec_get_deleted_flag(rec)) {
fprintf(stderr,
"InnoDB: Error: data dictionary entry for table %s is corrupt!\n"
"InnoDB: An index field is delete marked.\n",
table->name);
dict_load_report_deleted_index(table->name, i);
}
field = rec_get_nth_field(rec, 0, &len);
@ -487,11 +495,8 @@ dict_load_fields(
field = rec_get_nth_field(rec, 4, &len);
col_name = mem_heap_alloc(heap, len + 1);
ut_memcpy(col_name, field, len);
col_name[len] = '\0';
dict_mem_index_add_field(index, col_name, 0, prefix_len);
dict_mem_index_add_field(index,
mem_heap_strdupl(heap, field, len), 0, prefix_len);
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
}
@ -575,10 +580,8 @@ dict_load_indexes(
}
if (rec_get_deleted_flag(rec)) {
fprintf(stderr,
"InnoDB: Error: data dictionary entry for table %s is corrupt!\n"
"InnoDB: An index is delete marked.\n",
table->name);
dict_load_report_deleted_index(table->name,
ULINT_UNDEFINED);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@ -596,10 +599,7 @@ dict_load_indexes(
dict_table_get_first_index(sys_indexes), 4))->name));
field = rec_get_nth_field(rec, 4, &name_len);
name_buf = mem_heap_alloc(heap, name_len + 1);
ut_memcpy(name_buf, field, name_len);
name_buf[name_len] = '\0';
name_buf = mem_heap_strdupl(heap, field, name_len);
field = rec_get_nth_field(rec, 5, &len);
n_fields = mach_read_from_4(field);
@ -620,11 +620,13 @@ dict_load_indexes(
if (page_no == FIL_NULL) {
fprintf(stderr,
"InnoDB: Error: trying to load index %s for table %s\n"
"InnoDB: but the index tree has been freed!\n",
name_buf, table->name);
fputs("InnoDB: Error: trying to load index ", stderr);
ut_print_name(stderr, name_buf);
fputs(" for table ", stderr);
ut_print_name(stderr, table->name);
fputs("\n"
"InnoDB: but the index tree has been freed!\n", stderr);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@ -634,10 +636,12 @@ dict_load_indexes(
if ((type & DICT_CLUSTERED) == 0
&& NULL == dict_table_get_first_index(table)) {
fprintf(stderr,
"InnoDB: Error: trying to load index %s for table %s\n"
"InnoDB: but the first index was not clustered!\n",
name_buf, table->name);
fputs("InnoDB: Error: trying to load index ", stderr);
ut_print_namel(stderr, name_buf, name_len);
fputs(" for table ", stderr);
ut_print_name(stderr, table->name);
fputs("\n"
"InnoDB: but the first index is not clustered!\n", stderr);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@ -648,7 +652,7 @@ dict_load_indexes(
if (is_sys_table
&& ((type & DICT_CLUSTERED)
|| ((table == dict_sys->sys_tables)
&& (name_len == ut_strlen("ID_IND"))
&& (name_len == (sizeof "ID_IND") - 1)
&& (0 == ut_memcmp(name_buf, (char*) "ID_IND",
name_len))))) {
@ -702,7 +706,6 @@ dict_load_table(
rec_t* rec;
byte* field;
ulint len;
char* buf;
ulint space;
ulint n_cols;
ulint err;
@ -802,15 +805,13 @@ dict_load_table(
if (table->type == DICT_TABLE_CLUSTER_MEMBER) {
ut_error;
#if 0 /* clustered tables have not been implemented yet */
field = rec_get_nth_field(rec, 6, &len);
table->mix_id = mach_read_from_8(field);
field = rec_get_nth_field(rec, 8, &len);
buf = mem_heap_alloc(heap, len);
ut_memcpy(buf, field, len);
table->cluster_name = buf;
table->cluster_name = mem_heap_strdupl(heap, field, len);
#endif
}
if ((table->type == DICT_TABLE_CLUSTER)
@ -879,7 +880,6 @@ dict_load_table_on_id(
byte* field;
ulint len;
dict_table_t* table;
char* name;
mtr_t mtr;
#ifdef UNIV_SYNC_DEBUG
@ -942,13 +942,8 @@ dict_load_table_on_id(
/* Now we get the table name from the record */
field = rec_get_nth_field(rec, 1, &len);
name = mem_heap_alloc(heap, len + 1);
ut_memcpy(name, field, len);
name[len] = '\0';
/* Load the table definition to memory */
table = dict_load_table(name);
table = dict_load_table(mem_heap_strdupl(heap, field, len));
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@ -995,7 +990,6 @@ dict_load_foreign_cols(
btr_pcur_t pcur;
dtuple_t* tuple;
dfield_t* dfield;
char* col_name;
rec_t* rec;
byte* field;
ulint len;
@ -1040,21 +1034,13 @@ dict_load_foreign_cols(
ut_a(i == mach_read_from_4(field));
field = rec_get_nth_field(rec, 4, &len);
col_name = mem_heap_alloc(foreign->heap, len + 1);
ut_memcpy(col_name, field, len);
col_name[len] = '\0';
foreign->foreign_col_names[i] = col_name;
foreign->foreign_col_names[i] =
mem_heap_strdupl(foreign->heap, field, len);
field = rec_get_nth_field(rec, 5, &len);
foreign->referenced_col_names[i] =
mem_heap_strdupl(foreign->heap, field, len);
col_name = mem_heap_alloc(foreign->heap, len + 1);
ut_memcpy(col_name, field, len);
col_name[len] = '\0';
foreign->referenced_col_names[i] = col_name;
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
}
@ -1110,8 +1096,10 @@ dict_load_foreign(
|| rec_get_deleted_flag(rec)) {
/* Not found */
fprintf(stderr,
"InnoDB: Error A: cannot load foreign constraint %s\n", id);
fputs("InnoDB: Error A: cannot load foreign constraint ",
stderr);
ut_print_name(stderr, id);
putc('\n', stderr);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@ -1125,8 +1113,10 @@ dict_load_foreign(
/* Check if the id in record is the searched one */
if (len != ut_strlen(id) || ut_memcmp(id, field, len) != 0) {
fprintf(stderr,
"InnoDB: Error B: cannot load foreign constraint %s\n", id);
fputs("InnoDB: Error B: cannot load foreign constraint ",
stderr);
ut_print_name(stderr, id);
putc('\n', stderr);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@ -1151,23 +1141,15 @@ dict_load_foreign(
foreign->type = foreign->n_fields >> 24;
foreign->n_fields = foreign->n_fields & 0xFFFFFFUL;
foreign->id = mem_heap_alloc(foreign->heap, ut_strlen(id) + 1);
ut_memcpy(foreign->id, id, ut_strlen(id) + 1);
foreign->id = mem_heap_strdup(foreign->heap, id);
field = rec_get_nth_field(rec, 3, &len);
foreign->foreign_table_name = mem_heap_alloc(foreign->heap, 1 + len);
ut_memcpy(foreign->foreign_table_name, field, len);
foreign->foreign_table_name[len] = '\0';
foreign->foreign_table_name =
mem_heap_strdupl(foreign->heap, field, len);
field = rec_get_nth_field(rec, 4, &len);
foreign->referenced_table_name = mem_heap_alloc(foreign->heap,
1 + len);
ut_memcpy(foreign->referenced_table_name, field, len);
foreign->referenced_table_name[len] = '\0';
foreign->referenced_table_name =
mem_heap_strdupl(foreign->heap, field, len);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@ -1281,10 +1263,7 @@ loop:
/* Now we get a foreign key constraint id */
field = rec_get_nth_field(rec, 1, &len);
id = mem_heap_alloc(heap, len + 1);
ut_memcpy(id, field, len);
id[len] = '\0';
id = mem_heap_strdupl(heap, field, len);
btr_pcur_store_position(&pcur, &mtr);

View File

@ -49,9 +49,7 @@ dict_mem_table_create(
table->heap = heap;
str = mem_heap_alloc(heap, 1 + ut_strlen(name));
ut_strcpy(str, name);
str = mem_heap_strdup(heap, name);
table->type = DICT_TABLE_ORDINARY;
table->name = str;
@ -148,7 +146,6 @@ dict_mem_table_add_col(
ulint len, /* in: length */
ulint prec) /* in: precision */
{
char* str;
dict_col_t* col;
dtype_t* type;
@ -156,15 +153,11 @@ dict_mem_table_add_col(
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
table->n_def++;
col = dict_table_get_nth_col(table, table->n_def - 1);
str = mem_heap_alloc(table->heap, 1 + ut_strlen(name));
ut_strcpy(str, name);
col->ind = table->n_def - 1;
col->name = str;
col->name = mem_heap_strdup(table->heap, name);
col->table = table;
col->ord_part = 0;
@ -190,7 +183,6 @@ dict_mem_index_create(
ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */
ulint n_fields) /* in: number of fields */
{
char* str;
dict_index_t* index;
mem_heap_t* heap;
@ -201,13 +193,9 @@ dict_mem_index_create(
index->heap = heap;
str = mem_heap_alloc(heap, 1 + ut_strlen(index_name));
ut_strcpy(str, index_name);
index->type = type;
index->space = space;
index->name = str;
index->name = mem_heap_strdup(heap, index_name);
index->table_name = table_name;
index->table = NULL;
index->n_def = 0;
@ -303,56 +291,3 @@ dict_mem_index_free(
{
mem_heap_free(index->heap);
}
/**************************************************************************
Creates a procedure memory object. */
dict_proc_t*
dict_mem_procedure_create(
/*======================*/
/* out, own: procedure object */
char* name, /* in: procedure name */
char* sql_string, /* in: procedure definition as an SQL
string */
que_fork_t* graph) /* in: parsed procedure graph */
{
dict_proc_t* proc;
proc_node_t* proc_node;
mem_heap_t* heap;
char* str;
ut_ad(name);
heap = mem_heap_create(128);
proc = mem_heap_alloc(heap, sizeof(dict_proc_t));
proc->heap = heap;
str = mem_heap_alloc(heap, 1 + ut_strlen(name));
ut_strcpy(str, name);
proc->name = str;
str = mem_heap_alloc(heap, 1 + ut_strlen(sql_string));
ut_strcpy(str, sql_string);
proc->sql_string = str;
UT_LIST_INIT(proc->graphs);
/* UT_LIST_ADD_LAST(graphs, proc->graphs, graph); */
#ifdef UNIV_DEBUG
UT_LIST_VALIDATE(graphs, que_t, proc->graphs);
#endif
proc->mem_fix = 0;
proc_node = que_fork_get_child(graph);
proc_node->dict_proc = proc;
return(proc);
}

View File

@ -311,12 +311,13 @@ eval_predefined_2(
arg = que_node_get_next(arg);
}
printf("\n");
putc('\n', stderr);
} else if (func == PARS_ASSERT_TOKEN) {
if (!eval_node_get_ibool_val(arg1)) {
printf("SQL assertion fails in a stored procedure!\n");
fputs("SQL assertion fails in a stored procedure!\n",
stderr);
}
ut_a(eval_node_get_ibool_val(arg1));
@ -667,7 +668,6 @@ eval_predefined(
{
que_node_t* arg1;
lint int_val;
byte* str1;
byte* data;
int func;
@ -681,21 +681,63 @@ eval_predefined(
} else if (func == PARS_TO_CHAR_TOKEN) {
/* Convert number to character string as a
signed decimal integer. */
ulint uint_val;
int int_len;
int_val = eval_node_get_int_val(arg1);
data = eval_node_ensure_val_buf(func_node, 11);
sprintf((char*)data, "%10li", int_val);
/* Determine the length of the string. */
dfield_set_len(que_node_get_val(func_node), 10);
if (int_val == 0) {
int_len = 1; /* the number 0 occupies 1 byte */
} else {
int_len = 0;
if (int_val < 0) {
uint_val = ((ulint) -int_val - 1) + 1;
int_len++; /* reserve space for minus sign */
} else {
uint_val = (ulint) int_val;
}
for (; uint_val > 0; int_len++) {
uint_val /= 10;
}
}
/* allocate the string */
data = eval_node_ensure_val_buf(func_node, int_len + 1);
/* add terminating NUL character */
data[int_len] = 0;
/* convert the number */
if (int_val == 0) {
data[0] = '0';
} else {
int tmp;
if (int_val < 0) {
data[0] = '-'; /* preceding minus sign */
uint_val = ((ulint) -int_val - 1) + 1;
} else {
uint_val = (ulint) int_val;
}
for (tmp = int_len; uint_val > 0; uint_val /= 10) {
data[--tmp] = '0' + (byte)(uint_val % 10);
}
}
dfield_set_len((dfield_t*) que_node_get_val(func_node),
int_len);
return;
} else if (func == PARS_TO_NUMBER_TOKEN) {
str1 = dfield_get_data(que_node_get_val(arg1));
int_val = atoi((char*)str1);
int_val = atoi((char*)
dfield_get_data(que_node_get_val(arg1)));
} else if (func == PARS_SYSDATE_TOKEN) {
int_val = (lint)ut_time();

View File

@ -86,7 +86,7 @@ the count drops to zero. */
/* When mysqld is run, the default directory "." is the mysqld datadir,
but in the MySQL Embedded Server Library and ibbackup it is not the default
directory, and we must set the base file path explicitly */
char* fil_path_to_mysql_datadir = (char*)".";
const char* fil_path_to_mysql_datadir = ".";
ulint fil_n_pending_log_flushes = 0;
ulint fil_n_pending_tablespace_flushes = 0;
@ -399,7 +399,6 @@ fil_node_create(
fil_system_t* system = fil_system;
fil_node_t* node;
fil_space_t* space;
char* name2;
ut_a(system);
ut_a(name);
@ -408,11 +407,7 @@ fil_node_create(
node = mem_alloc(sizeof(fil_node_t));
name2 = mem_alloc(ut_strlen(name) + 1);
ut_strcpy(name2, name);
node->name = name2;
node->name = mem_strdup(name);
node->open = FALSE;
ut_a(!is_raw || srv_start_raw_disk_in_use);
@ -433,7 +428,7 @@ fil_node_create(
fprintf(stderr,
" InnoDB: Error: Could not find tablespace %lu for\n"
"InnoDB: file %s from the tablespace memory cache.\n", (ulong) id, name);
mem_free(name2);
mem_free(node->name);
mem_free(node);
@ -816,7 +811,6 @@ fil_space_create(
{
fil_system_t* system = fil_system;
fil_space_t* space;
char* name2;
ulint namesake_id;
try_again:
/*printf(
@ -881,11 +875,7 @@ try_again:
space = mem_alloc(sizeof(fil_space_t));
name2 = mem_alloc(ut_strlen(name) + 1);
ut_strcpy(name2, name);
space->name = name2;
space->name = mem_strdup(name);
space->id = id;
system->tablespace_version++;
@ -2737,7 +2727,7 @@ fil_load_single_table_tablespaces(void)
/* The datadir of MySQL is always the default directory of mysqld */
dir = os_file_opendir(fil_path_to_mysql_datadir, TRUE);
dir = os_file_opendir((char*) fil_path_to_mysql_datadir, TRUE);
if (dir == NULL) {
@ -2749,7 +2739,7 @@ fil_load_single_table_tablespaces(void)
/* Scan all directories under the datadir. They are the database
directories of MySQL. */
ret = os_file_readdir_next_file(fil_path_to_mysql_datadir, dir,
ret = os_file_readdir_next_file((char*) fil_path_to_mysql_datadir, dir,
&dbinfo);
while (ret == 0) {
/* printf("Looking at %s in datadir\n", dbinfo.name); */
@ -2810,7 +2800,7 @@ next_file_item:
}
next_datadir_item:
ret = os_file_readdir_next_file(fil_path_to_mysql_datadir,
ret = os_file_readdir_next_file((char*) fil_path_to_mysql_datadir,
dir, &dbinfo);
}
@ -3726,7 +3716,7 @@ fil_aio_wait(
ut_ad(fil_validate());
if (os_aio_use_native_aio) {
srv_io_thread_op_info[segment] = (char *) "handle native aio";
srv_set_io_thread_op_info(segment, "native aio handle");
#ifdef WIN_ASYNC_IO
ret = os_aio_windows_handle(segment, 0, (void**) &fil_node,
&message, &type);
@ -3737,7 +3727,7 @@ fil_aio_wait(
ut_error;
#endif
} else {
srv_io_thread_op_info[segment] =(char *)"handle simulated aio";
srv_set_io_thread_op_info(segment, "simulated aio handle");
ret = os_aio_simulated_handle(segment, (void**) &fil_node,
&message, &type);
@ -3745,7 +3735,7 @@ fil_aio_wait(
ut_a(ret);
srv_io_thread_op_info[segment] = (char *) "complete io for fil node";
srv_set_io_thread_op_info(segment, "complete io for fil node");
mutex_enter(&(system->mutex));
@ -3762,11 +3752,10 @@ fil_aio_wait(
open, and use a special i/o thread to serve insert buffer requests. */
if (buf_pool_is_block(message)) {
srv_io_thread_op_info[segment] =
(char *) "complete io for buf page";
srv_set_io_thread_op_info(segment, "complete io for buf page");
buf_page_io_complete(message);
} else {
srv_io_thread_op_info[segment] =(char *) "complete io for log";
srv_set_io_thread_op_info(segment, "complete io for log");
log_io_complete(message);
}
}
@ -3847,7 +3836,9 @@ retry:
mutex_exit(&(system->mutex));
/* printf("Flushing to file %s\n", node->name); */
/* fprintf(stderr, "Flushing to file %s\n",
node->name); */
os_file_flush(file);
mutex_enter(&(system->mutex));

View File

@ -1426,7 +1426,7 @@ fsp_alloc_free_page(
hint % FSP_EXTENT_SIZE, mtr);
if (free == ULINT_UNDEFINED) {
ut_print_buf(((byte*)descr) - 500, 1000);
ut_print_buf(stderr, ((byte*)descr) - 500, 1000);
ut_error;
}
@ -1507,11 +1507,10 @@ fsp_free_page(
xdes_t* descr;
ulint state;
ulint frag_n_used;
char buf[1000];
ut_ad(mtr);
/* printf("Freeing page %lu in space %lu\n", page, space); */
/* fprintf(stderr, "Freeing page %lu in space %lu\n", page, space); */
header = fsp_get_space_header(space, mtr);
@ -1524,9 +1523,9 @@ fsp_free_page(
"InnoDB: Error: File space extent descriptor of page %lu has state %lu\n",
(ulong) page,
(ulong) state);
ut_sprintf_buf(buf, ((byte*)descr) - 50, 200);
fprintf(stderr, "InnoDB: Dump of descriptor: %s\n", buf);
fputs("InnoDB: Dump of descriptor: ", stderr);
ut_print_buf(stderr, ((byte*)descr) - 50, 200);
putc('\n', stderr);
if (state == XDES_FREE) {
/* We put here some fault tolerance: if the page
@ -1538,14 +1537,12 @@ fsp_free_page(
ut_error;
}
if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
== TRUE) {
if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)) {
fprintf(stderr,
"InnoDB: Error: File space extent descriptor of page %lu says it is free\n",
(ulong) page);
ut_sprintf_buf(buf, ((byte*)descr) - 50, 200);
fprintf(stderr, "InnoDB: Dump of descriptor: %s\n", buf);
"InnoDB: Error: File space extent descriptor of page %lu says it is free\n"
"InnoDB: Dump of descriptor: ", (ulong) page);
ut_print_buf(stderr, ((byte*)descr) - 50, 200);
putc('\n', stderr);
/* We put here some fault tolerance: if the page
is already free, return without doing anything! */
@ -1603,7 +1600,7 @@ fsp_free_extent(
if (xdes_get_state(descr, mtr) == XDES_FREE) {
ut_print_buf(((byte*)descr) - 500, 1000);
ut_print_buf(stderr, (byte*)descr - 500, 1000);
ut_error;
}
@ -2949,7 +2946,6 @@ fseg_free_page_low(
dulint descr_id;
dulint seg_id;
ulint i;
char errbuf[200];
ut_ad(seg_inode && mtr);
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N) ==
@ -2963,22 +2959,22 @@ fseg_free_page_low(
descr = xdes_get_descriptor(space, page, mtr);
ut_a(descr);
if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
!= FALSE) {
ut_sprintf_buf(errbuf, descr, 40);
fprintf(stderr,
"InnoDB: Dump of the tablespace extent descriptor: %s\n", errbuf);
if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)) {
fputs("InnoDB: Dump of the tablespace extent descriptor: ",
stderr);
ut_print_buf(stderr, descr, 40);
fprintf(stderr,
fprintf(stderr, "\n"
"InnoDB: Serious error! InnoDB is trying to free page %lu\n"
"InnoDB: though it is already marked as free in the tablespace!\n"
"InnoDB: The tablespace free space info is corrupt.\n"
"InnoDB: You may need to dump your InnoDB tables and recreate the whole\n"
"InnoDB: database!\n", (ulong) page);
fprintf(stderr,
crash:
fputs(
"InnoDB: If the InnoDB recovery crashes here, see section 6.1\n"
"InnoDB: of http://www.innodb.com/ibman.html about forcing recovery.\n");
"InnoDB: of http://www.innodb.com/ibman.php about forcing recovery.\n",
stderr);
ut_error;
}
@ -3018,12 +3014,12 @@ fseg_free_page_low(
ut_dulint_get_low(seg_id));
*/
if (0 != ut_dulint_cmp(descr_id, seg_id)) {
ut_sprintf_buf(errbuf, descr, 40);
fprintf(stderr,
"InnoDB: Dump of the tablespace extent descriptor: %s\n", errbuf);
ut_sprintf_buf(errbuf, seg_inode, 40);
fprintf(stderr,
"InnoDB: Dump of the segment inode: %s\n", errbuf);
fputs("InnoDB: Dump of the tablespace extent descriptor: ",
stderr);
ut_print_buf(stderr, descr, 40);
fputs("\nInnoDB: Dump of the segment inode: ", stderr);
ut_print_buf(stderr, seg_inode, 40);
putc('\n', stderr);
fprintf(stderr,
"InnoDB: Serious error: InnoDB is trying to free space %lu page %lu,\n"
@ -3034,11 +3030,7 @@ fseg_free_page_low(
(ulong) ut_dulint_get_low(descr_id),
(ulong) ut_dulint_get_high(seg_id),
(ulong) ut_dulint_get_low(seg_id));
fprintf(stderr,
"InnoDB: If the InnoDB recovery crashes here, see section 6.1\n"
"InnoDB: of http://www.innodb.com/ibman.html about forcing recovery.\n");
ut_error;
goto crash;
}
not_full_n_used = mtr_read_ulint(seg_inode + FSEG_NOT_FULL_N_USED,
@ -3484,7 +3476,8 @@ fseg_validate_low(
return(TRUE);
}
#ifdef UNIV_DEBUG
/***********************************************************************
Validates a segment. */
@ -3509,6 +3502,7 @@ fseg_validate(
return(ret);
}
#endif /* UNIV_DEBUG */
/***********************************************************************
Writes info of a segment. */
@ -3543,7 +3537,7 @@ fseg_print_low(
seg_id_low = ut_dulint_get_low(d_var);
seg_id_high = ut_dulint_get_high(d_var);
n_used = mtr_read_ulint(inode + FSEG_NOT_FULL_N_USED,
MLOG_4BYTES, mtr);
n_frag = fseg_get_n_frag_pages(inode, mtr);
@ -3551,17 +3545,16 @@ fseg_print_low(
n_not_full = flst_get_len(inode + FSEG_NOT_FULL, mtr);
n_full = flst_get_len(inode + FSEG_FULL, mtr);
printf(
"SEGMENT id %lu %lu space %lu; page %lu; res %lu used %lu; full ext %lu\n",
(ulong) seg_id_high, (ulong) seg_id_low, (ulong) space,
(ulong) page_no, (ulong) reserved, (ulong) used,
(ulong) n_full);
printf(
"fragm pages %lu; free extents %lu; not full extents %lu: pages %lu\n",
fprintf(stderr,
"SEGMENT id %lu %lu space %lu; page %lu; res %lu used %lu; full ext %lu\n"
"fragm pages %lu; free extents %lu; not full extents %lu: pages %lu\n",
(ulong) seg_id_high, (ulong) seg_id_low, (ulong) space, (ulong) page_no,
(ulong) reserved, (ulong) used, (ulong) n_full,
(ulong) n_frag, (ulong) n_free, (ulong) n_not_full,
(ulong) n_used);
}
#ifdef UNIV_DEBUG
/***********************************************************************
Writes info of a segment. */
@ -3582,6 +3575,7 @@ fseg_print(
fseg_print_low(inode, mtr);
}
#endif /* UNIV_DEBUG */
/***********************************************************************
Validates the file space system and its segments. */
@ -3862,16 +3856,15 @@ fsp_print(
seg_id_low = ut_dulint_get_low(d_var);
seg_id_high = ut_dulint_get_high(d_var);
printf("FILE SPACE INFO: id %lu\n", (ulong) space);
printf("size %lu, free limit %lu, free extents %lu\n",
(ulong) size, (ulong) free_limit, (ulong) n_free);
printf(
"not full frag extents %lu: used pages %lu, full frag extents %lu\n",
(ulong) n_free_frag, (ulong) frag_n_used, (ulong) n_full_frag);
printf("first seg id not used %lu %lu\n", (ulong) seg_id_high,
(ulong) seg_id_low);
fprintf(stderr,
"FILE SPACE INFO: id %lu\n"
"size %lu, free limit %lu, free extents %lu\n"
"not full frag extents %lu: used pages %lu, full frag extents %lu\n"
"first seg id not used %lu %lu\n",
(long) space,
(ulong) size, (ulong) free_limit, (ulong) n_free,
(ulong) n_free_frag, (ulong) frag_n_used, (ulong) n_full_frag,
(ulong) seg_id_high, (ulong) seg_id_low);
mtr_commit(&mtr);
@ -3950,5 +3943,5 @@ fsp_print(
mtr_commit(&mtr2);
printf("NUMBER of file segments: %lu\n", (ulong) n_segs);
fprintf(stderr, "NUMBER of file segments: %lu\n", (ulong) n_segs);
}

View File

@ -490,6 +490,7 @@ flst_validate(
return(TRUE);
}
#ifdef UNIV_DEBUG
/************************************************************************
Prints info of a file-based list. */
@ -509,9 +510,11 @@ flst_print(
len = flst_get_len(base, mtr);
printf("FILE-BASED LIST:\n");
printf("Base node in space %lu page %lu byte offset %lu; len %lu\n",
fprintf(stderr,
"FILE-BASED LIST:\n"
"Base node in space %lu page %lu byte offset %lu; len %lu\n",
(ulong) buf_frame_get_space_id(frame),
(ulong) buf_frame_get_page_no(frame),
(ulong) (base - frame), (ulong) len);
}
#endif /* UNIV_DEBUG */

View File

@ -317,22 +317,13 @@ Prints info of a hash table. */
void
ha_print_info(
/*==========*/
char* buf, /* in/out: buffer where to print */
char* buf_end,/* in: buffer end */
FILE* file, /* in: file where to print */
hash_table_t* table) /* in: hash table */
{
hash_cell_t* cell;
/* ha_node_t* node;
ulint nodes = 0;
ulint len = 0;
ulint max_len = 0; */
ulint cells = 0;
ulint n_bufs;
ulint i;
if (buf_end - buf < 200) {
return;
}
for (i = 0; i < hash_get_n_cells(table); i++) {
@ -341,33 +332,12 @@ ha_print_info(
if (cell->node) {
cells++;
/*
len = 0;
node = cell->node;
for (;;) {
len++;
nodes++;
if (ha_chain_get_next(table, node) == NULL) {
break;
}
node = node->next;
}
if (len > max_len) {
max_len = len;
}
*/
}
}
buf += sprintf(buf,
"Hash table size %lu, used cells %lu", (ulong) hash_get_n_cells(table),
(ulong) cells);
fprintf(file,
"Hash table size %lu, used cells %lu",
(ulong) hash_get_n_cells(table), (ulong) cells);
if (table->heaps == NULL && table->heap != NULL) {
@ -380,6 +350,6 @@ ha_print_info(
n_bufs++;
}
buf += sprintf(buf, ", node heap has %lu buffer(s)\n", (ulong) n_bufs);
fprintf(file, ", node heap has %lu buffer(s)\n", (ulong) n_bufs);
}
}

View File

@ -131,9 +131,10 @@ access order rules. */
#define IBUF_POOL_SIZE_PER_MAX_SIZE 2
/* The insert buffer control structure */
ibuf_t* ibuf = NULL;
ibuf_t* ibuf = NULL;
ulint ibuf_rnd = 986058871;
static
ulint ibuf_rnd = 986058871;
ulint ibuf_flush_count = 0;
@ -142,9 +143,9 @@ ulint ibuf_flush_count = 0;
#define IBUF_COUNT_N_PAGES 2000
/* Buffered entry counts for file pages, used in debugging */
ulint* ibuf_counts[IBUF_COUNT_N_SPACES];
static ulint* ibuf_counts[IBUF_COUNT_N_SPACES];
ibool ibuf_counts_inited = FALSE;
static ibool ibuf_counts_inited = FALSE;
/* The start address for an insert buffer bitmap page bitmap */
#define IBUF_BITMAP PAGE_DATA
@ -158,15 +159,18 @@ ibool ibuf_counts_inited = FALSE;
/* Number of bits describing a single page */
#define IBUF_BITS_PER_PAGE 4
#if IBUF_BITS_PER_PAGE % 2
# error "IBUF_BITS_PER_PAGE must be an even number!"
#endif
/* The mutex used to block pessimistic inserts to ibuf trees */
mutex_t ibuf_pessimistic_insert_mutex;
static mutex_t ibuf_pessimistic_insert_mutex;
/* The mutex protecting the insert buffer structs */
mutex_t ibuf_mutex;
static mutex_t ibuf_mutex;
/* The mutex protecting the insert buffer bitmaps */
mutex_t ibuf_bitmap_mutex;
static mutex_t ibuf_bitmap_mutex;
/* The area in pages from which contract looks for page numbers for merge */
#define IBUF_MERGE_AREA 8
@ -197,13 +201,15 @@ because ibuf merge is done to a page when it is read in, and it is
still physically like the index page even if the index would have been
dropped! So, there seems to be no problem. */
#ifdef UNIV_DEBUG
/**********************************************************************
Validates the ibuf data structures when the caller owns ibuf_mutex. */
static
ibool
ibuf_validate_low(void);
/*===================*/
/* out: TRUE if ok */
#endif /* UNIV_DEBUG */
/**********************************************************************
Sets the flag in the current OS thread local storage denoting that it is
@ -326,9 +332,9 @@ ibuf_count_get(
return(*(ibuf_counts[space] + page_no));
}
#ifdef UNIV_IBUF_DEBUG
/**********************************************************************
Sets the ibuf count for a given page. */
#ifdef UNIV_IBUF_DEBUG
static
void
ibuf_count_set(
@ -437,7 +443,7 @@ ibuf_data_sizes_update(
ibuf->size = ibuf->size + data->size - old_size;
/* printf("ibuf size %lu, space ibuf size %lu\n", ibuf->size,
/* fprintf(stderr, "ibuf size %lu, space ibuf size %lu\n", ibuf->size,
data->size); */
}
@ -468,7 +474,7 @@ ibuf_data_init_for_space(
#ifdef UNIV_LOG_DEBUG
if (space % 2 == 1) {
printf("No ibuf op in replicate space\n");
fputs("No ibuf op in replicate space\n", stderr);
return(NULL);
}
@ -766,7 +772,8 @@ ibuf_set_free_bits_low(
bitmap_page = ibuf_bitmap_get_map_page(buf_frame_get_space_id(page),
buf_frame_get_page_no(page), mtr);
#ifdef UNIV_IBUF_DEBUG
/* printf("Setting page no %lu free bits to %lu should be %lu\n",
/* fprintf(stderr,
"Setting page no %lu free bits to %lu should be %lu\n",
buf_frame_get_page_no(page), val,
ibuf_index_page_calc_free(page)); */
@ -820,7 +827,7 @@ ibuf_set_free_bits(
buf_frame_get_page_no(page),
IBUF_BITMAP_FREE, &mtr);
if (old_val != max_val) {
/* printf(
/* fprintf(stderr,
"Ibuf: page %lu old val %lu max val %lu\n",
buf_frame_get_page_no(page), old_val, max_val); */
}
@ -829,7 +836,7 @@ ibuf_set_free_bits(
#endif
}
#ifdef UNIV_IBUF_DEBUG
/* printf("Setting page no %lu free bits to %lu should be %lu\n",
/* fprintf(stderr, "Setting page no %lu free bits to %lu should be %lu\n",
buf_frame_get_page_no(page), val,
ibuf_index_page_calc_free(page)); */
@ -1014,7 +1021,7 @@ ibuf_page_low(
#ifdef UNIV_LOG_DEBUG
if (space % 2 != 0) {
printf("No ibuf in a replicate space\n");
fputs("No ibuf in a replicate space\n", stderr);
return(FALSE);
}
@ -1735,7 +1742,8 @@ ibuf_free_excess_pages(
/* Not yet initialized */
#ifdef UNIV_DEBUG
/*printf("Ibuf for space %lu not yet initialized\n", space); */
/*fprintf(stderr,
"Ibuf for space %lu not yet initialized\n", space); */
#endif
return;
@ -1933,7 +1941,7 @@ ibuf_get_merge_page_nos(
#ifdef UNIV_IBUF_DEBUG
ut_a(*n_stored <= IBUF_MAX_N_PAGES_MERGED);
#endif
/* printf("Ibuf merge batch %lu pages %lu volume\n", *n_stored,
/* fprintf(stderr, "Ibuf merge batch %lu pages %lu volume\n", *n_stored,
sum_volumes); */
return(sum_volumes);
}
@ -2044,8 +2052,8 @@ loop:
space_ids, space_versions, page_nos,
&n_stored);
#ifdef UNIV_IBUF_DEBUG
/* printf("Ibuf contract sync %lu pages %lu volume %lu\n", sync,
n_stored, sum_sizes); */
/* fprintf(stderr, "Ibuf contract sync %lu pages %lu volume %lu\n",
sync, n_stored, sum_sizes); */
#endif
ibuf_exit();
@ -2431,7 +2439,7 @@ ibuf_insert_low(
mutex_exit(&ibuf_mutex);
#ifdef UNIV_IBUF_DEBUG
printf("Ibuf too big\n");
fputs("Ibuf too big\n", stderr);
#endif
/* Use synchronous contract (== TRUE) */
ibuf_contract(TRUE);
@ -2664,8 +2672,8 @@ ibuf_insert(
if (err == DB_SUCCESS) {
#ifdef UNIV_IBUF_DEBUG
/* printf("Ibuf insert for page no %lu of index %s\n", page_no,
index->name); */
/* fprintf(stderr, "Ibuf insert for page no %lu of index %s\n",
page_no, index->name); */
#endif
return(TRUE);
@ -2693,7 +2701,6 @@ ibuf_insert_to_index_page(
rec_t* rec;
page_t* bitmap_page;
ulint old_bits;
char errbuf[1000];
ut_ad(ibuf_inside());
ut_ad(dtuple_check_typed(entry));
@ -2703,17 +2710,17 @@ ibuf_insert_to_index_page(
fprintf(stderr,
"InnoDB: Trying to insert a record from the insert buffer to an index page\n"
"InnoDB: but the number of fields does not match!\n%s\n", errbuf);
"InnoDB: but the number of fields does not match!\n");
buf_page_print(page);
dtuple_sprintf(errbuf, 900, entry);
dtuple_print(stderr, entry);
fprintf(stderr,
fputs(
"InnoDB: The table where where this index record belongs\n"
"InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
"InnoDB: your tables.\n"
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n");
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr);
return;
}
@ -2743,14 +2750,14 @@ ibuf_insert_to_index_page(
"InnoDB: Error: Insert buffer insert fails; page free %lu, dtuple size %lu\n",
(ulong) page_get_max_insert_size(page, 1),
(ulong) rec_get_converted_size(entry));
dtuple_sprintf(errbuf, 900, entry);
fprintf(stderr,
"InnoDB: Cannot insert index record %s\n"
"InnoDB: The table where where this index record belongs\n"
fputs("InnoDB: Cannot insert index record ",
stderr);
dtuple_print(stderr, entry);
fputs(
"\nInnoDB: The table where where this index record belongs\n"
"InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
"InnoDB: that table.\n", errbuf);
"InnoDB: that table.\n", stderr);
bitmap_page = ibuf_bitmap_get_map_page(
buf_frame_get_space_id(page),
buf_frame_get_page_no(page),
@ -2762,8 +2769,8 @@ ibuf_insert_to_index_page(
fprintf(stderr, "Bitmap bits %lu\n", (ulong) old_bits);
fprintf(stderr,
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n");
fputs(
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr);
}
}
}
@ -2826,23 +2833,21 @@ ibuf_delete_rec(
if (!success) {
fprintf(stderr,
"InnoDB: ERROR: Send the output to mysql@lists.mysql.com\n"
"InnoDB: ibuf cursor restoration fails!\n"
"InnoDB: ibuf record inserted to space %lu page %lu\n", (ulong) space,
(ulong) page_no);
"InnoDB: ERROR: Send the output to mysql@lists.mysql.com\n"
"InnoDB: ibuf cursor restoration fails!\n"
"InnoDB: ibuf record inserted to page %lu\n", (ulong) page_no);
fflush(stderr);
rec_print(btr_pcur_get_rec(pcur));
rec_print(pcur->old_rec);
dtuple_print(search_tuple);
rec_print(stderr, btr_pcur_get_rec(pcur));
rec_print(stderr, pcur->old_rec);
dtuple_print(stderr, search_tuple);
rec_print(page_rec_get_next(btr_pcur_get_rec(pcur)));
fflush(stdout);
rec_print(stderr, page_rec_get_next(btr_pcur_get_rec(pcur)));
fflush(stderr);
btr_pcur_commit_specify_mtr(pcur, mtr);
fprintf(stderr,
"InnoDB: Validating insert buffer tree:\n");
fputs("InnoDB: Validating insert buffer tree:\n", stderr);
ut_a(btr_validate_tree(ibuf_data->index->tree));
fprintf(stderr, "InnoDB: ibuf tree ok\n");
@ -2902,20 +2907,16 @@ ibuf_merge_or_delete_for_page(
dtuple_t* entry;
dtuple_t* search_tuple;
rec_t* ibuf_rec;
ibool closed;
buf_block_t* block;
page_t* bitmap_page;
ibuf_data_t* ibuf_data;
ibool success;
ulint n_inserts;
#ifdef UNIV_IBUF_DEBUG
ulint volume;
ulint old_bits;
ulint new_bits;
dulint max_trx_id;
#endif
ibool tablespace_being_deleted = FALSE;
ibool corruption_noticed = FALSE;
mtr_t mtr;
char err_buf[500];
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
@ -2925,7 +2926,7 @@ ibuf_merge_or_delete_for_page(
#ifdef UNIV_LOG_DEBUG
if (space % 2 != 0) {
printf("No ibuf operation in a replicate space\n");
fputs("No ibuf operation in a replicate space\n", stderr);
return;
}
@ -3004,8 +3005,8 @@ ibuf_merge_or_delete_for_page(
mtr_start(&mtr);
fprintf(stderr,
" InnoDB: Dump of the ibuf bitmap page:\n");
fputs(" InnoDB: Dump of the ibuf bitmap page:\n",
stderr);
bitmap_page = ibuf_bitmap_get_map_page(space, page_no,
&mtr);
@ -3013,7 +3014,7 @@ ibuf_merge_or_delete_for_page(
mtr_commit(&mtr);
fprintf(stderr, "\nInnoDB: Dump of the page:\n");
fputs("\nInnoDB: Dump of the page:\n", stderr);
buf_page_print(page);
@ -3032,12 +3033,14 @@ ibuf_merge_or_delete_for_page(
}
n_inserts = 0;
#ifdef UNIV_IBUF_DEBUG
volume = 0;
#endif
loop:
mtr_start(&mtr);
if (page) {
success = buf_page_get_known_nowait(RW_X_LATCH, page,
ibool success = buf_page_get_known_nowait(RW_X_LATCH, page,
BUF_KEEP_OLD,
IB__FILE__, __LINE__,
&mtr);
@ -3072,9 +3075,9 @@ loop:
}
if (corruption_noticed) {
rec_sprintf(err_buf, 450, ibuf_rec);
fprintf(stderr,
"InnoDB: Discarding record\n %s\n from the insert buffer!\n\n", err_buf);
fputs("InnoDB: Discarding record\n ", stderr);
rec_print(stderr, ibuf_rec);
fputs("\n from the insert buffer!\n\n", stderr);
} else if (page) {
/* Now we have at pcur a record which should be
inserted to the index page; NOTE that the call below
@ -3082,7 +3085,7 @@ loop:
keep the latch to the ibuf_rec page until the
insertion is finished! */
max_trx_id = page_get_max_trx_id(
dulint max_trx_id = page_get_max_trx_id(
buf_frame_align(ibuf_rec));
page_update_max_trx_id(page, max_trx_id);
@ -3099,9 +3102,8 @@ loop:
n_inserts++;
/* Delete the record from ibuf */
closed = ibuf_delete_rec(space, page_no, &pcur, search_tuple,
&mtr);
if (closed) {
if (ibuf_delete_rec(space, page_no, &pcur, search_tuple,
&mtr)) {
/* Deletion was pessimistic and mtr was committed:
we start from the beginning again */
@ -3127,12 +3129,12 @@ reset_bit:
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, &mtr);
ibuf_bitmap_page_set_bits(bitmap_page, page_no,
IBUF_BITMAP_BUFFERED, FALSE, &mtr);
if (page) {
old_bits = ibuf_bitmap_page_get_bits(bitmap_page,
page_no, IBUF_BITMAP_FREE, &mtr);
new_bits = ibuf_index_page_calc_free(page);
if (page) {
ulint old_bits = ibuf_bitmap_page_get_bits(bitmap_page,
page_no, IBUF_BITMAP_FREE, &mtr);
ulint new_bits = ibuf_index_page_calc_free(page);
#ifdef UNIV_IBUF_DEBUG
/* printf("Old bits %lu new bits %lu max size %lu\n",
/* fprintf(stderr, "Old bits %lu new bits %lu max size %lu\n",
old_bits, new_bits,
page_get_max_insert_size_after_reorganize(page, 1)); */
#endif
@ -3144,7 +3146,8 @@ reset_bit:
}
}
#ifdef UNIV_IBUF_DEBUG
/* printf("Ibuf merge %lu records volume %lu to page no %lu\n",
/* fprintf(stderr,
"Ibuf merge %lu records volume %lu to page no %lu\n",
n_inserts, volume, page_no); */
#endif
mtr_commit(&mtr);
@ -3276,9 +3279,10 @@ leave_loop:
mem_heap_free(heap);
}
#ifdef UNIV_DEBUG
/**********************************************************************
Validates the ibuf data structures when the caller owns ibuf_mutex. */
static
ibool
ibuf_validate_low(void)
/*===================*/
@ -3305,6 +3309,7 @@ ibuf_validate_low(void)
return(TRUE);
}
#endif /* UNIV_DEBUG */
/**********************************************************************
Looks if the insert buffer is empty. */
@ -3362,36 +3367,36 @@ Prints info of ibuf. */
void
ibuf_print(
/*=======*/
char* buf, /* in/out: buffer where to print */
char* buf_end)/* in: buffer end */
FILE* file) /* in: file where to print */
{
ibuf_data_t* data;
#ifdef UNIV_IBUF_DEBUG
ulint i;
#endif
if (buf_end - buf < 500) {
return;
}
mutex_enter(&ibuf_mutex);
data = UT_LIST_GET_FIRST(ibuf->data_list);
while (data) {
buf += sprintf(buf,
fprintf(file,
"Ibuf for space %lu: size %lu, free list len %lu, seg size %lu,",
(ulong) data->space, (ulong) data->size,
(ulong) data->free_list_len,
(ulong) data->seg_size);
if (data->empty) {
buf += sprintf(buf, " is empty\n");
fputs(" is empty\n", file);
} else {
buf += sprintf(buf, " is not empty\n");
fputs(" is not empty\n", file);
}
buf += sprintf(buf,
fprintf(file,
"Ibuf for space %lu: size %lu, free list len %lu, seg size %lu,\n"
"%lu inserts, %lu merged recs, %lu merges\n",
(ulong) data->space,
(ulong) data->size,
(ulong) data->free_list_len,
(ulong) data->seg_size,
(ulong) data->n_inserts,
(ulong) data->n_merged_recs,
(ulong) data->n_merges);
@ -3399,7 +3404,8 @@ ibuf_print(
for (i = 0; i < IBUF_COUNT_N_PAGES; i++) {
if (ibuf_count_get(data->space, i) > 0) {
printf("Ibuf count for page %lu is %lu\n",
fprintf(stderr,
"Ibuf count for page %lu is %lu\n",
(ulong) i,
(ulong) ibuf_count_get(data->space, i));
}

View File

@ -392,6 +392,7 @@ btr_page_free_low(
page_t* page, /* in: page to be freed, x-latched */
ulint level, /* in: page level */
mtr_t* mtr); /* in: mtr */
#ifdef UNIV_DEBUG
/*****************************************************************
Prints size info of a B-tree. */
@ -408,6 +409,7 @@ btr_print_tree(
dict_tree_t* tree, /* in: tree */
ulint width); /* in: print this many entries from start
and end */
#endif /* UNIV_DEBUG */
/****************************************************************
Checks the size and number of fields in a record based on the definition of
the index. */

View File

@ -54,9 +54,11 @@ Created 11/5/1995 Heikki Tuuri
#define BUF_KEEP_OLD 52
extern buf_pool_t* buf_pool; /* The buffer pool of the database */
#ifdef UNIV_DEBUG
extern ibool buf_debug_prints;/* If this is set TRUE, the program
prints info whenever read or flush
occurs */
#endif /* UNIV_DEBUG */
/************************************************************************
Creates the buffer pool. */
@ -476,12 +478,14 @@ buf_pool_is_block(
/*==============*/
/* out: TRUE if pointer to block */
void* ptr); /* in: pointer to memory */
#ifdef UNIV_DEBUG
/*************************************************************************
Validates the buffer pool data structure. */
ibool
buf_validate(void);
/*==============*/
#endif /* UNIV_DEBUG */
/************************************************************************
Prints a page to stderr. */
@ -507,8 +511,7 @@ Prints info of the buffer i/o. */
void
buf_print_io(
/*=========*/
char* buf, /* in/out: buffer where to print */
char* buf_end);/* in: buffer end */
FILE* file); /* in: file where to print */
/*************************************************************************
Returns the ratio in percents of modified pages in the buffer pool /
database pages in the buffer pool. */
@ -894,7 +897,7 @@ struct buf_pool_struct{
ulint n_pend_reads; /* number of pending read operations */
time_t last_printout_time; /* when buf_print was last time
time_t last_printout_time; /* when buf_print_io was last time
called */
ulint n_pages_read; /* number read operations */
ulint n_pages_written;/* number write operations */
@ -909,10 +912,10 @@ struct buf_pool_struct{
ulint n_pages_awe_remapped; /* if AWE is enabled, the
number of remaps of blocks to
buffer frames */
ulint n_page_gets_old;/* n_page_gets when buf_print was
ulint n_page_gets_old;/* n_page_gets when buf_print_io was
last time called: used to calculate
hit rate */
ulint n_pages_read_old;/* n_pages_read when buf_print was
ulint n_pages_read_old;/* n_pages_read when buf_print_io was
last time called */
ulint n_pages_written_old;/* number write operations */
ulint n_pages_created_old;/* number of pages created in

View File

@ -11,10 +11,6 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0rea.h"
#include "mtr0mtr.h"
extern ulint buf_dbg_counter; /* This is used to insert validation
operations in execution in the
debug version */
/************************************************************************
Recommends a move of a block to the start of the LRU list if there is danger
of dropping from the buffer pool. NOTE: does not reserve the buffer pool
@ -215,14 +211,14 @@ buf_block_align(
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: trying to access a stray pointer %lx\n"
"InnoDB: buf pool start is at %lx, end at %lx\n"
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n"
"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
"InnoDB: how to force recovery.\n",
(long)ptr, (long)frame_zero,
(long)(buf_pool->high_end));
ptr, frame_zero,
buf_pool->high_end);
ut_error;
}
@ -251,14 +247,14 @@ buf_frame_align(
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: trying to access a stray pointer %lx\n"
"InnoDB: buf pool start is at %lx, end at %lx\n"
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n"
"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
"InnoDB: how to force recovery.\n",
(long)ptr, (long)(buf_pool->frame_zero),
(long)(buf_pool->high_end));
ptr, buf_pool->frame_zero,
buf_pool->high_end);
ut_error;
}

View File

@ -97,6 +97,7 @@ buf_flush_ready_for_replace(
/* out: TRUE if can replace immediately */
buf_block_t* block); /* in: buffer control block, must be in state
BUF_BLOCK_FILE_PAGE and in the LRU list */
#ifdef UNIV_DEBUG
/**********************************************************************
Validates the flush list. */
@ -104,6 +105,7 @@ ibool
buf_flush_validate(void);
/*====================*/
/* out: TRUE if ok */
#endif /* UNIV_DEBUG */
/* When buf_flush_free_margin is called, it tries to make this many blocks
available to replacement in the free list and at the end of the LRU list (to

View File

@ -112,6 +112,7 @@ void
buf_LRU_make_block_old(
/*===================*/
buf_block_t* block); /* in: control block */
#ifdef UNIV_DEBUG
/**************************************************************************
Validates the LRU list. */
@ -124,6 +125,7 @@ Prints the LRU list. */
void
buf_LRU_print(void);
/*===============*/
#endif /* UNIV_DEBUG */
#ifndef UNIV_NONINL
#include "buf0lru.ic"

View File

@ -294,6 +294,7 @@ dtuple_check_typed_no_assert(
/*=========================*/
/* out: TRUE if ok */
dtuple_t* tuple); /* in: tuple */
#ifdef UNIV_DEBUG
/**************************************************************
Validates the consistency of a tuple which must be complete, i.e,
all fields must have been set. */
@ -303,6 +304,7 @@ dtuple_validate(
/*============*/
/* out: TRUE if ok */
dtuple_t* tuple); /* in: tuple */
#endif /* UNIV_DEBUG */
/*****************************************************************
Pretty prints a dfield value according to its data type. */
@ -324,16 +326,7 @@ The following function prints the contents of a tuple. */
void
dtuple_print(
/*=========*/
dtuple_t* tuple); /* in: tuple */
/**************************************************************
The following function prints the contents of a tuple to a buffer. */
ulint
dtuple_sprintf(
/*===========*/
/* out: printed length in bytes */
char* buf, /* in: print buffer */
ulint buf_len,/* in: buf length in bytes */
FILE* f, /* in: output stream */
dtuple_t* tuple); /* in: tuple */
/******************************************************************
Moves parts of long fields in entry to the big record vector so that

View File

@ -299,7 +299,7 @@ dtuple_get_data_size(
ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n = DATA_TUPLE_MAGIC_N);
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
n_fields = tuple->n_fields;
@ -355,7 +355,7 @@ dtuple_fold(
ulint fold;
ut_ad(tuple);
ut_ad(tuple->magic_n = DATA_TUPLE_MAGIC_N);
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
ut_ad(dtuple_check_typed(tuple));
fold = ut_fold_dulint(tree_id);

View File

@ -305,6 +305,7 @@ dtype_new_read_for_order_and_null_size(
/*===================================*/
dtype_t* type, /* in: type struct */
byte* buf); /* in: buffer for stored type order info */
#ifdef UNIV_DEBUG
/*************************************************************************
Validates a data type structure. */
@ -313,6 +314,7 @@ dtype_validate(
/*===========*/
/* out: TRUE if ok */
dtype_t* type); /* in: type struct to validate */
#endif /* UNIV_DEBUG */
/*************************************************************************
Prints a data type structure. */

View File

@ -32,20 +32,21 @@ Get the database name length in a table name. */
ulint
dict_get_db_name_len(
/*=================*/
/* out: database name length */
char* name); /* in: table name in the form dbname '/' tablename */
/* out: database name length */
const char* name); /* in: table name in the form
dbname '/' tablename */
/*************************************************************************
Accepts a specified string. Comparisons are case-insensitive. */
char*
const char*
dict_accept(
/*========*/
/* out: if string was accepted, the pointer
is moved after that, else ptr is returned */
char* ptr, /* in: scan from this */
const char* string,/* in: accept only this string as the next
non-whitespace string */
ibool* success);/* out: TRUE if accepted */
/* out: if string was accepted, the pointer
is moved after that, else ptr is returned */
const char* ptr, /* in: scan from this */
const char* string, /* in: accept only this string as the next
non-whitespace string */
ibool* success);/* out: TRUE if accepted */
/************************************************************************
Decrements the count of open MySQL handles to a table. */
@ -69,41 +70,6 @@ database directories. */
void
dict_load_space_id_list(void);
/*=========================*/
/**************************************************************************
Returns a stored procedure object and memoryfixes it. */
UNIV_INLINE
dict_proc_t*
dict_procedure_get(
/*===============*/
/* out: procedure, NULL if does not exist */
char* proc_name, /* in: table name */
trx_t* trx); /* in: transaction handle or NULL */
/**************************************************************************
Adds a stored procedure object to the dictionary cache. */
void
dict_procedure_add_to_cache(
/*========================*/
dict_proc_t* proc); /* in: procedure */
/**************************************************************************
Reserves a parsed copy of a stored procedure to execute. If there are no
free parsed copies left at the moment, parses a new copy. Takes the copy off
the list of copies: the copy must be returned there with
dict_procedure_release_parsed_copy. */
que_t*
dict_procedure_reserve_parsed_copy(
/*===============================*/
/* out: the query graph */
dict_proc_t* proc); /* in: dictionary procedure node */
/**************************************************************************
Releases a parsed copy of an executed stored procedure. Puts the copy to the
list of copies. */
void
dict_procedure_release_parsed_copy(
/*===============================*/
que_t* graph); /* in: query graph of a stored procedure */
/*************************************************************************
Gets the column data type. */
UNIV_INLINE
@ -270,7 +236,7 @@ dict_foreign_parse_drop_constraints(
dict_table_t* table, /* in: table */
ulint* n, /* out: number of constraints
to drop */
char*** constraints_to_drop); /* out: id's of the
const char*** constraints_to_drop); /* out: id's of the
constraints to drop */
/**************************************************************************
Returns a table object and memoryfixes it. NOTE! This is a high-level
@ -354,19 +320,20 @@ dict_table_get_index_noninline(
dict_table_t* table, /* in: table */
char* name); /* in: index name */
/**************************************************************************
Prints a table definition. */
void
dict_table_print(
/*=============*/
dict_table_t* table); /* in: table */
/**************************************************************************
Prints a table data. */
void
dict_table_print_low(
/*=================*/
dict_table_t* table); /* in: table */
#ifdef UNIV_DEBUG
/**************************************************************************
Prints a table definition. */
void
dict_table_print(
/*=============*/
dict_table_t* table); /* in: table */
/**************************************************************************
Prints a table data when we know the table name. */
@ -374,8 +341,9 @@ void
dict_table_print_by_name(
/*=====================*/
char* name);
#endif /* UNIV_DEBUG */
/**************************************************************************
Sprintfs to a string info on foreign keys of a table. */
Outputs info on foreign keys of a table. */
void
dict_print_info_on_foreign_keys(
@ -384,19 +352,23 @@ dict_print_info_on_foreign_keys(
a format suitable to be inserted into
a CREATE TABLE, otherwise in the format
of SHOW TABLE STATUS */
char* str, /* in/out: pointer to a string */
ulint len, /* in: space in str available for info */
FILE* file, /* in: file where to print */
dict_table_t* table); /* in: table */
/**************************************************************************
Sprintfs to a string info on a foreign key of a table in a format suitable
for CREATE TABLE. */
char*
Outputs info on a foreign key of a table in a format suitable for
CREATE TABLE. */
void
dict_print_info_on_foreign_key_in_create_format(
/*============================================*/
/* out: how far in buf we printed */
dict_foreign_t* foreign,/* in: foreign key constraint */
char* buf); /* in: buffer of at least 5000 bytes */
FILE* file, /* in: file where to print */
dict_foreign_t* foreign);/* in: foreign key constraint */
/************************************************************************
Displays the names of the index and the table. */
void
dict_index_name_print(
/*==================*/
FILE* file, /* in: output stream */
const dict_index_t* index); /* in: index to print */
/************************************************************************
Gets the first index on the table (the clustered index). */
UNIV_INLINE
@ -899,14 +871,21 @@ Releases the dictionary system mutex for MySQL. */
void
dict_mutex_exit_for_mysql(void);
/*===========================*/
/************************************************************************
Checks if the database name in two table names is the same. */
/* The following len must be at least 10000 bytes! */
#define DICT_FOREIGN_ERR_BUF_LEN 10000
ibool
dict_tables_have_same_db(
/*=====================*/
/* out: TRUE if same db name */
const char* name1, /* in: table name in the form
dbname '/' tablename */
const char* name2); /* in: table name in the form
dbname '/' tablename */
/* Buffers for storing detailed information about the latest foreign key
and unique key errors */
extern char* dict_foreign_err_buf;
extern char* dict_unique_err_buf;
extern FILE* dict_foreign_err_file;
extern mutex_t dict_foreign_err_mutex; /* mutex protecting the buffers */
extern dict_sys_t* dict_sys; /* the dictionary system */
@ -932,8 +911,6 @@ struct dict_sys_struct{
hash_table_t* table_id_hash; /* hash table of the tables, based
on id */
hash_table_t* col_hash; /* hash table of the columns */
hash_table_t* procedure_hash; /* hash table of the stored
procedures */
UT_LIST_BASE_NODE_T(dict_table_t)
table_LRU; /* LRU list of tables */
ulint size; /* varying space in bytes occupied

View File

@ -581,37 +581,6 @@ dict_table_get_low(
return(table);
}
/**************************************************************************
Returns a stored procedure object and memoryfixes it. */
UNIV_INLINE
dict_proc_t*
dict_procedure_get(
/*===============*/
/* out: procedure, NULL if does not exist */
char* proc_name, /* in: table name */
trx_t* trx) /* in: transaction handle or NULL */
{
dict_proc_t* proc;
ulint name_fold;
UT_NOT_USED(trx);
mutex_enter(&(dict_sys->mutex));
/* Look for the table name in the hash table */
name_fold = ut_fold_string(proc_name);
HASH_SEARCH(name_hash, dict_sys->procedure_hash, name_fold, proc,
ut_strcmp(proc->name, proc_name) == 0);
if (proc != NULL) {
proc->mem_fix++;
}
mutex_exit(&(dict_sys->mutex));
return(proc);
}
/**************************************************************************
Returns a table object, based on table id, and memoryfixes it. */
UNIV_INLINE

View File

@ -132,18 +132,6 @@ dict_foreign_t*
dict_mem_foreign_create(void);
/*=========================*/
/* out, own: foreign constraint struct */
/**************************************************************************
Creates a procedure memory object. */
dict_proc_t*
dict_mem_procedure_create(
/*======================*/
/* out, own: procedure object */
char* name, /* in: procedure name */
char* sql_string, /* in: procedure definition as an SQL
string */
que_fork_t* graph); /* in: parsed procedure graph */
/* Data structure for a column in a table */
struct dict_col_struct{
@ -427,24 +415,6 @@ struct dict_table_struct{
#endif /* UNIV_DEBUG */
};
/* Data structure for a stored procedure */
struct dict_proc_struct{
mem_heap_t* heap; /* memory heap */
char* name; /* procedure name */
char* sql_string;
/* procedure definition as an SQL string:
we can produce more parsed instances of the
procedure by parsing this string */
hash_node_t name_hash;
/* hash chain node */
UT_LIST_BASE_NODE_T(que_fork_t) graphs;
/* list of parsed instances of the procedure:
there may be many of them, and they are
recycled */
ulint mem_fix;/* count of how many times this struct
has been fixed in memory */
};
#ifndef UNIV_NONINL
#include "dict0mem.ic"
#endif

View File

@ -15,7 +15,6 @@ typedef struct dict_field_struct dict_field_t;
typedef struct dict_index_struct dict_index_t;
typedef struct dict_tree_struct dict_tree_t;
typedef struct dict_table_struct dict_table_t;
typedef struct dict_proc_struct dict_proc_t;
typedef struct dict_foreign_struct dict_foreign_t;
/* A cluster object is a table object with the type field set to

View File

@ -19,7 +19,7 @@ Created 10/25/1995 Heikki Tuuri
/* When mysqld is run, the default directory "." is the mysqld datadir, but in
ibbackup we must set it explicitly; the patgh must NOT contain the trailing
'/' or '\' */
extern char* fil_path_to_mysql_datadir;
extern const char* fil_path_to_mysql_datadir;
/* Initial size of a single-table tablespace in pages */
#define FIL_IBD_FILE_INITIAL_SIZE 4

View File

@ -332,6 +332,7 @@ void
fsp_print(
/*======*/
ulint space); /* in: space id */
#ifdef UNIV_DEBUG
/***********************************************************************
Validates a segment. */
@ -349,6 +350,7 @@ fseg_print(
/*=======*/
fseg_header_t* header, /* in: segment header */
mtr_t* mtr); /* in: mtr */
#endif /* UNIV_DEBUG */
/* Flags for fsp_reserve_free_extents */
#define FSP_NORMAL 1000000

View File

@ -181,6 +181,7 @@ flst_validate(
/* out: TRUE if ok */
flst_base_node_t* base, /* in: pointer to base node of list */
mtr_t* mtr1); /* in: mtr */
#ifdef UNIV_DEBUG
/************************************************************************
Prints info of a file-based list. */
@ -189,7 +190,7 @@ flst_print(
/*=======*/
flst_base_node_t* base, /* in: pointer to base node of list */
mtr_t* mtr); /* in: mtr */
#endif /* UNIV_DEBUG */
#ifndef UNIV_NONINL
#include "fut0lst.ic"

View File

@ -127,8 +127,7 @@ Prints info of a hash table. */
void
ha_print_info(
/*==========*/
char* buf, /* in/out: buffer where to print */
char* buf_end,/* in: buffer end */
FILE* file, /* in: file where to print */
hash_table_t* table); /* in: hash table */
/* The hash table external chain node */

View File

@ -131,35 +131,6 @@ ha_search_and_get_data(
return(NULL);
}
/*****************************************************************
Returns the next matching hash table node in chain. */
UNIV_INLINE
ha_node_t*
ha_next(
/*====*/
/* out: pointer to the next hash table node
in chain with the fold value, NULL if not
found */
ha_node_t* node) /* in: hash table node */
{
ulint fold;
fold = node->fold;
node = ha_chain_get_next(node);
while (node) {
if (node->fold == fold) {
return(node);
}
node = ha_chain_get_next(node);
}
return(NULL);
}
/*************************************************************
Looks for an element when we know the pointer to the data. */
UNIV_INLINE

View File

@ -290,8 +290,7 @@ Prints info of ibuf. */
void
ibuf_print(
/*=======*/
char* buf, /* in/out: buffer where to print */
char* buf_end);/* in: buffer end */
FILE* file); /* in: file where to print */
#define IBUF_HEADER_PAGE_NO FSP_IBUF_HEADER_PAGE_NO
#define IBUF_TREE_ROOT_PAGE_NO FSP_IBUF_TREE_ROOT_PAGE_NO

View File

@ -19,7 +19,11 @@ Created 5/7/1996 Heikki Tuuri
#include "read0types.h"
#include "hash0hash.h"
#ifdef UNIV_DEBUG
extern ibool lock_print_waits;
#endif /* UNIV_DEBUG */
/* Buffer for storing information about the most recent deadlock error */
extern FILE* lock_latest_err_file;
/*************************************************************************
Gets the size of a lock struct. */
@ -377,7 +381,9 @@ lock_table(
/* out: DB_SUCCESS, DB_LOCK_WAIT,
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
does nothing */
does nothing;
if LOCK_TABLE_EXP bits are set,
creates an explicit table lock */
dict_table_t* table, /* in: database table in dictionary cache */
ulint mode, /* in: lock mode */
que_thr_t* thr); /* in: query thread */
@ -390,6 +396,14 @@ lock_is_on_table(
/* out: TRUE if there are lock(s) */
dict_table_t* table); /* in: database table in dictionary cache */
/*************************************************************************
Releases a table lock.
Releases possible other transactions waiting for this lock. */
void
lock_table_unlock(
/*==============*/
lock_t* lock); /* in: lock */
/*************************************************************************
Releases an auto-inc lock a transaction possibly has on a table.
Releases possible other transactions waiting for this lock. */
@ -406,6 +420,14 @@ lock_release_off_kernel(
/*====================*/
trx_t* trx); /* in: transaction */
/*************************************************************************
Releases table locks, and releases possible other transactions waiting
because of these locks. */
void
lock_release_tables_off_kernel(
/*===========================*/
trx_t* trx); /* in: transaction */
/*************************************************************************
Cancels a waiting lock request and releases possible other transactions
waiting behind it. */
@ -453,6 +475,7 @@ lock_check_trx_id_sanity(
dict_index_t* index, /* in: clustered index */
ibool has_kernel_mutex);/* in: TRUE if the caller owns the
kernel mutex */
#ifdef UNIV_DEBUG
/*************************************************************************
Validates the lock queue on a single record. */
@ -462,14 +485,14 @@ lock_rec_queue_validate(
/* out: TRUE if ok */
rec_t* rec, /* in: record to look at */
dict_index_t* index); /* in: index, or NULL if not known */
#endif /* UNIV_DEBUG */
/*************************************************************************
Prints info of a table lock. */
void
lock_table_print(
/*=============*/
char* buf, /* in/out: buffer where to print, must be at least
500 bytes */
FILE* file, /* in: file where to print */
lock_t* lock); /* in: table type lock */
/*************************************************************************
Prints info of a record lock. */
@ -477,8 +500,7 @@ Prints info of a record lock. */
void
lock_rec_print(
/*===========*/
char* buf, /* in/out: buffer where to print, must be at least
500 bytes */
FILE* file, /* in: file where to print */
lock_t* lock); /* in: record type lock */
/*************************************************************************
Prints info of locks for all transactions. */
@ -486,8 +508,8 @@ Prints info of locks for all transactions. */
void
lock_print_info(
/*============*/
char* buf, /* in/out: buffer where to print */
char* buf_end);/* in: buffer end */
FILE* file); /* in: file where to print */
#ifdef UNIV_DEBUG
/*************************************************************************
Validates the lock queue on a table. */
@ -512,6 +534,7 @@ ibool
lock_validate(void);
/*===============*/
/* out: TRUE if ok */
#endif /* UNIV_DEBUG */
/* The lock system */
extern lock_sys_t* lock_sys;
@ -531,6 +554,7 @@ extern lock_sys_t* lock_sys;
/* Lock types */
#define LOCK_TABLE 16 /* these type values should be so high that */
#define LOCK_REC 32 /* they can be ORed to the lock mode */
#define LOCK_TABLE_EXP 80 /* explicit table lock */
#define LOCK_TYPE_MASK 0xF0UL /* mask used to extract lock type from the
type_mode field in a lock */
/* Waiting lock flag */

View File

@ -366,7 +366,6 @@ Writes a buffer to a log file group. */
void
log_group_write_buf(
/*================*/
ulint type, /* in: LOG_FLUSH or LOG_RECOVER */
log_group_t* group, /* in: log group */
byte* buf, /* in: buffer */
ulint len, /* in: buffer len; must be divisible
@ -513,8 +512,7 @@ Prints info of the log. */
void
log_print(
/*======*/
char* buf, /* in/out: buffer where to print */
char* buf_end);/* in: buffer end */
FILE* file); /* in: file where to print */
/**********************************************************
Peeks the current lsn. */

View File

@ -31,6 +31,7 @@ check fields at the both ends of the field. */
#define MEM_SPACE_NEEDED(N) ut_calc_align((N), UNIV_MEM_ALIGNMENT)
#endif
#ifdef UNIV_DEBUG
/*******************************************************************
Checks a memory heap for consistency and prints the contents if requested.
Outputs the sum of sizes of buffers given to the user (only in
@ -60,6 +61,7 @@ mem_heap_validate_or_print(
ulint* n_blocks); /* out: number of blocks in the heap,
if a NULL pointer is passed as this
argument, it is ignored */
#endif /* UNIV_DEBUG */
#ifdef UNIV_MEM_DEBUG
/******************************************************************
Prints the contents of a memory heap. */
@ -69,6 +71,7 @@ mem_heap_print(
/*===========*/
mem_heap_t* heap); /* in: memory heap */
#endif /* UNIV_MEM_DEBUG */
#ifdef UNIV_DEBUG
/******************************************************************
Checks that an object is a memory heap (or a block of it) */
@ -85,6 +88,7 @@ mem_heap_validate(
/*==============*/
/* out: TRUE if ok */
mem_heap_t* heap); /* in: memory heap */
#endif /* UNIV_DEBUG */
#ifdef UNIV_MEM_DEBUG
/*********************************************************************
TRUE if no memory is currently allocated. */

View File

@ -56,6 +56,7 @@ mem_hash_insert(
mem_heap_t* heap, /* in: the created heap */
char* file_name, /* in: file name of creation */
ulint line); /* in: line where created */
#ifdef UNIV_MEM_DEBUG
/*******************************************************************
Removes a memory heap (which is going to be freed by the caller)
from the list of live memory heaps. Returns the size of the heap
@ -71,7 +72,7 @@ mem_hash_remove(
mem_heap_t* heap, /* in: the heap to be freed */
char* file_name, /* in: file name of freeing */
ulint line); /* in: line where freed */
#endif /* UNIV_MEM_DEBUG */
void
mem_field_header_set_len(byte* field, ulint len);

View File

@ -271,6 +271,59 @@ mem_realloc(
ulint n, /* in: desired number of bytes */
char* file_name,/* in: file name where called */
ulint line); /* in: line where called */
/**************************************************************************
Duplicates a NUL-terminated string. */
UNIV_INLINE
char*
mem_strdup(
/*=======*/
/* out, own: a copy of the string,
must be deallocated with mem_free */
const char* str); /* in: string to be copied */
/**************************************************************************
Makes a NUL-terminated copy of a nonterminated string. */
UNIV_INLINE
char*
mem_strdupl(
/*========*/
/* out, own: a copy of the string,
must be deallocated with mem_free */
const char* str, /* in: string to be copied */
ulint len); /* in: length of str, in bytes */
/**************************************************************************
Makes a NUL-terminated quoted copy of a NUL-terminated string. */
UNIV_INLINE
char*
mem_strdupq(
/*========*/
/* out, own: a quoted copy of the string,
must be deallocated with mem_free */
const char* str, /* in: string to be copied */
char q); /* in: quote character */
/**************************************************************************
Duplicates a NUL-terminated string, allocated from a memory heap. */
UNIV_INLINE
char*
mem_heap_strdup(
/*============*/
/* out, own: a copy of the string */
mem_heap_t* heap, /* in: memory heap where string is allocated */
const char* str); /* in: string to be copied */
/**************************************************************************
Makes a NUL-terminated copy of a nonterminated string,
allocated from a memory heap. */
UNIV_INLINE
char*
mem_heap_strdupl(
/*=============*/
/* out, own: a copy of the string */
mem_heap_t* heap, /* in: memory heap where string is allocated */
const char* str, /* in: string to be copied */
ulint len); /* in: length of str, in bytes */
#ifdef MEM_PERIODIC_CHECK
/**********************************************************************
Goes through the list of all allocated mem blocks, checks their magic

View File

@ -579,3 +579,99 @@ mem_realloc(
return(mem_alloc_func(n, file_name, line));
}
/**************************************************************************
Duplicates a NUL-terminated string. */
UNIV_INLINE
char*
mem_strdup(
/*=======*/
/* out, own: a copy of the string,
must be deallocated with mem_free */
const char* str) /* in: string to be copied */
{
ulint len = strlen(str) + 1;
return(memcpy(mem_alloc(len), str, len));
}
/**************************************************************************
Makes a NUL-terminated copy of a nonterminated string. */
UNIV_INLINE
char*
mem_strdupl(
/*========*/
/* out, own: a copy of the string,
must be deallocated with mem_free */
const char* str, /* in: string to be copied */
ulint len) /* in: length of str, in bytes */
{
char* s = mem_alloc(len + 1);
s[len] = 0;
return(memcpy(s, str, len));
}
/**************************************************************************
Makes a NUL-terminated quoted copy of a NUL-terminated string. */
UNIV_INLINE
char*
mem_strdupq(
/*========*/
/* out, own: a quoted copy of the string,
must be deallocated with mem_free */
const char* str, /* in: string to be copied */
char q) /* in: quote character */
{
char* dst;
char* d;
const char* s = str;
int len = strlen(str) + 3;
/* calculate the number of quote characters in the string */
while((s = strchr(s, q)) != NULL) {
s++;
len++;
}
/* allocate the quoted string, and copy it */
d = dst = mem_alloc(len);
*d++ = q;
s = str;
while(*s) {
if ((*d++ = *s++) == q) {
*d++ = q;
}
}
*d++ = q;
*d++ = '\0';
ut_ad(len == d - dst);
return(dst);
}
/**************************************************************************
Duplicates a NUL-terminated string, allocated from a memory heap. */
UNIV_INLINE
char*
mem_heap_strdup(
/*============*/
/* out, own: a copy of the string */
mem_heap_t* heap, /* in: memory heap where string is allocated */
const char* str) /* in: string to be copied */
{
ulint len = strlen(str) + 1;
return(memcpy(mem_heap_alloc(heap, len), str, len));
}
/**************************************************************************
Makes a NUL-terminated copy of a nonterminated string,
allocated from a memory heap. */
UNIV_INLINE
char*
mem_heap_strdupl(
/*=============*/
/* out, own: a copy of the string */
mem_heap_t* heap, /* in: memory heap where string is allocated */
const char* str, /* in: string to be copied */
ulint len) /* in: length of str, in bytes */
{
char* s = mem_heap_alloc(heap, len + 1);
s[len] = 0;
return(memcpy(s, str, len));
}

View File

@ -85,6 +85,7 @@ Releases the mem pool mutex. */
void
mem_pool_mutex_exit(void);
/*=====================*/
#ifdef UNIV_DEBUG
/************************************************************************
Validates a memory pool. */
@ -101,7 +102,7 @@ mem_pool_print_info(
/*================*/
FILE* outfile,/* in: output file to write to */
mem_pool_t* pool); /* in: memory pool */
#endif /* UNIV_DEBUG */
#ifndef UNIV_NONINL
#include "mem0pool.ic"

View File

@ -171,7 +171,8 @@ mlog_write_initial_log_record_fast(
mtr->n_log_recs++;
#ifdef UNIV_LOG_DEBUG
/* printf("Adding to mtr log record type %lu space %lu page no %lu\n",
/* fprintf(stderr,
"Adding to mtr log record type %lu space %lu page no %lu\n",
type, space, offset); */
#endif

View File

@ -256,6 +256,7 @@ mtr_memo_contains(
mtr_t* mtr, /* in: mtr */
void* object, /* in: object to search */
ulint type); /* in: type of object */
#ifdef UNIV_DEBUG
/*************************************************************
Prints info of an mtr handle. */
@ -263,6 +264,7 @@ void
mtr_print(
/*======*/
mtr_t* mtr); /* in: mtr */
#endif /* UNIV_DEBUG */
/*######################################################################*/
#define MTR_BUF_MEMO_SIZE 200 /* number of slots in memo */

View File

@ -358,6 +358,14 @@ os_file_set_size(
size */
ulint size_high);/* in: most significant 32 bits of size */
/***************************************************************************
Truncates a file at its current position. */
ibool
os_file_set_eof(
/*============*/
/* out: TRUE if success */
FILE* file); /* in: file to be truncated */
/***************************************************************************
Flushes the write buffers of a given file to the disk. */
ibool
@ -647,8 +655,7 @@ Prints info of the aio arrays. */
void
os_aio_print(
/*=========*/
char* buf, /* in/out: buffer where to print */
char* buf_end);/* in: buffer end */
FILE* file); /* in: file where to print */
/**************************************************************************
Refreshes the statistics used to print per-second averages. */

View File

@ -43,6 +43,7 @@ opt_find_all_cols(
to add new found columns */
plan_t* plan, /* in: plan or NULL */
que_node_t* exp); /* in: expression or condition */
#ifdef UNIV_SQL_DEBUG
/************************************************************************
Prints info of a query plan. */
@ -50,6 +51,7 @@ void
opt_print_query_plan(
/*=================*/
sel_node_t* sel_node); /* in: select node */
#endif /* UNIV_SQL_DEBUG */
#ifndef UNIV_NONINL
#include "pars0opt.ic"

View File

@ -87,13 +87,6 @@ pars_get_lex_chars(
int max_size); /* in: maximum number of characters which fit
in the buffer */
/*****************************************************************
Instructs the lexical analyzer to stop when it receives the EOF integer. */
int
yywrap(void);
/*========*/
/* out: returns TRUE */
/*****************************************************************
Called by yyparse on error. */
void
@ -456,18 +449,6 @@ struct proc_node_struct{
sym_node_t* param_list; /* input and output parameters */
que_node_t* stat_list; /* statement list */
sym_tab_t* sym_tab; /* symbol table of this procedure */
dict_proc_t* dict_proc; /* stored procedure node in the
dictionary cache, if defined */
};
/* Stored procedure call node */
struct call_node_struct{
que_common_t common; /* type: QUE_NODE_CALL */
sym_node_t* proc_name; /* stored procedure name */
dict_proc_t* procedure_def; /* pointer to a stored procedure graph
in the dictionary stored procedure
cache */
sym_tab_t* sym_tab; /* symbol table of this query */
};
/* elsif-element node */

View File

@ -127,9 +127,6 @@ struct sym_node_struct{
dict_table_t* table; /* table definition
if a table id or a
column id */
dict_proc_t* procedure_def; /* stored procedure
definition, if a
stored procedure name */
ulint col_no; /* column number if a
column */
sel_buf_t* prefetch_buf; /* NULL, or a buffer

View File

@ -15,7 +15,6 @@ typedef struct pars_res_word_struct pars_res_word_t;
typedef struct func_node_struct func_node_t;
typedef struct order_node_struct order_node_t;
typedef struct proc_node_struct proc_node_t;
typedef struct call_node_struct call_node_t;
typedef struct elsif_node_struct elsif_node_t;
typedef struct if_node_struct if_node_t;
typedef struct while_node_struct while_node_t;

View File

@ -390,16 +390,7 @@ Prints a physical record. */
void
rec_print(
/*======*/
rec_t* rec); /* in: physical record */
/*******************************************************************
Prints a physical record to a buffer. */
ulint
rec_sprintf(
/*========*/
/* out: printed length in bytes */
char* buf, /* in: buffer to print to */
ulint buf_len,/* in: buffer length */
FILE* file, /* in: file where to print */
rec_t* rec); /* in: physical record */
#define REC_INFO_BITS 6 /* This is single byte bit-field */

View File

@ -190,7 +190,7 @@ rec_set_bit_field_2(
+ (REC_N_OWNED_MASK << (8 * (REC_N_OWNED - 3)))
+ (REC_INFO_BITS_MASK << (8 * (REC_INFO_BITS - 3))));
if (m != ut_dbg_zero + 0xFFFFFFFFUL) {
printf("Sum of masks %lx\n", m);
fprintf(stderr, "Sum of masks %lx\n", m);
ut_error;
}
}

View File

@ -161,6 +161,22 @@ row_lock_table_autoinc_for_mysql(
row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
table handle */
/*************************************************************************
Unlocks a table lock possibly reserved by trx. */
void
row_unlock_table_for_mysql(
/*=======================*/
trx_t* trx); /* in: transaction */
/*************************************************************************
Sets a table lock on the table mentioned in prebuilt. */
int
row_lock_table_for_mysql(
/*=====================*/
/* out: error code or DB_SUCCESS */
row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
table handle */
/*************************************************************************
Does an insert for MySQL. */
int
@ -337,7 +353,9 @@ row_drop_table_for_mysql(
/*=====================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: table name */
trx_t* trx); /* in: transaction handle */
trx_t* trx, /* in: transaction handle */
ibool drop_db);/* in: TRUE=dropping whole database */
/*************************************************************************
Discards the tablespace of a table which stored in an .ibd file. Discarding
means that this function deletes the .ibd file and assigns a new table id for

View File

@ -77,12 +77,9 @@ open_step(
if (err != DB_SUCCESS) {
/* SQL error detected */
printf("SQL error %lu\n", (unsigned long) err);
fprintf(stderr, "SQL error %lu\n", (ulong) err);
ut_error;
que_thr_handle_error(thr, err, NULL, 0);
return(NULL);
}
thr->run_node = que_node_get_parent(node);

View File

@ -26,8 +26,7 @@ ulint
row_undo_ins(
/*=========*/
/* out: DB_SUCCESS */
undo_node_t* node, /* in: row undo node */
que_thr_t* thr); /* in: query thread */
undo_node_t* node); /* in: row undo node */
#ifndef UNIV_NONINL

View File

@ -41,8 +41,7 @@ row_undo_search_clust_to_pcur(
/* out: TRUE if found; NOTE the node->pcur
must be closed by the caller, regardless of
the return value */
undo_node_t* node, /* in: row undo node */
que_thr_t* thr); /* in: query thread */
undo_node_t* node); /* in: row undo node */
/***************************************************************
Undoes a row operation in a table. This is a high-level function used
in SQL execution graphs. */

View File

@ -84,10 +84,12 @@ upd_field_set_field_no(
if (field_no >= dict_index_get_n_fields(index)) {
fprintf(stderr,
"InnoDB: Error: trying to access field %lu in table %s\n"
"InnoDB: index %s, but index has only %lu fields\n",
(unsigned long) field_no, index->table_name, index->name,
(unsigned long) dict_index_get_n_fields(index));
"InnoDB: Error: trying to access field %lu in ",
(ulong) field_no);
dict_index_name_print(stderr, index);
fprintf(stderr, "\n"
"InnoDB: but index only has %lu fields\n",
(ulong) dict_index_get_n_fields(index));
}
dtype_copy(dfield_get_type(&(upd_field->new_val)),

View File

@ -32,6 +32,11 @@ at a time */
/* This is set to TRUE if the MySQL user has set it in MySQL */
extern ibool srv_lower_case_table_names;
/* Mutex for locking srv_monitor_file */
extern mutex_t srv_monitor_file_mutex;
/* Temporary file for innodb monitor output */
extern FILE* srv_monitor_file;
/* Server parameters which are read from the initfile */
extern char* srv_data_home;
@ -162,8 +167,8 @@ extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs,
/* Array of English strings describing the current state of an
i/o handler thread */
extern char* srv_io_thread_op_info[];
extern char* srv_io_thread_function[];
extern const char* srv_io_thread_op_info[];
extern const char* srv_io_thread_function[];
typedef struct srv_sys_struct srv_sys_t;
@ -241,6 +246,15 @@ srv_get_thread_type(void);
/*=====================*/
/* out: SRV_COM, ... */
/*************************************************************************
Sets the info describing an i/o thread current state. */
void
srv_set_io_thread_op_info(
/*======================*/
ulint i, /* in: the 'segment' of the i/o thread */
const char* str); /* in: constant char string describing the
state */
/*************************************************************************
Releases threads of the type given from suspension in the thread table.
NOTE! The server mutex has to be reserved by the caller! */
@ -366,13 +380,12 @@ srv_error_monitor_thread(
void* arg); /* in: a dummy parameter required by
os_thread_create */
/**********************************************************************
Sprintfs to a buffer the output of the InnoDB Monitor. */
Outputs to a file the output of the InnoDB Monitor. */
void
srv_sprintf_innodb_monitor(
/*=======================*/
char* buf, /* in/out: buffer which must be at least 4 kB */
ulint len); /* in: length of the buffer */
srv_printf_innodb_monitor(
/*======================*/
FILE* file); /* in: output stream */
/* Types for the threads existing in the system. Threads of types 4 - 9

View File

@ -114,8 +114,7 @@ Prints info of the wait array. */
void
sync_array_print_info(
/*==================*/
char* buf, /* in/out: buffer where to print */
char* buf_end,/* in: buffer end */
FILE* file, /* in: file where to print */
sync_array_t* arr); /* in: wait array */

View File

@ -85,6 +85,7 @@ void
rw_lock_free(
/*=========*/
rw_lock_t* lock); /* in: rw-lock */
#ifdef UNIV_DEBUG
/**********************************************************************
Checks that the rw-lock has been initialized and that there are no
simultaneous shared and exclusive locks. */
@ -93,6 +94,7 @@ ibool
rw_lock_validate(
/*=============*/
rw_lock_t* lock);
#endif /* UNIV_DEBUG */
/******************************************************************
NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */

View File

@ -65,6 +65,15 @@ NOTE! The following macro should be used in mutex locking, not the
corresponding function. */
#define mutex_enter(M) mutex_enter_func((M), IB__FILE__, __LINE__)
/**********************************************************************
A noninlined function that reserves a mutex. In ha_innodb.cc we have disabled
inlining of InnoDB functions, and no inlined functions should be called from
there. That is why we need to duplicate the inlined function here. */
void
mutex_enter_noninline(
/*==================*/
mutex_t* mutex); /* in: mutex */
/******************************************************************
NOTE! The following macro should be used in mutex locking, not the
corresponding function. */
@ -105,6 +114,13 @@ mutex_exit(
/*=======*/
mutex_t* mutex); /* in: pointer to mutex */
/**********************************************************************
Releases a mutex. */
void
mutex_exit_noninline(
/*=================*/
mutex_t* mutex); /* in: mutex */
/**********************************************************************
Returns TRUE if no mutex or rw-lock is currently locked.
Works only in the debug version. */
@ -119,16 +135,15 @@ Prints wait info of the sync system. */
void
sync_print_wait_info(
/*=================*/
char* buf, /* in/out: buffer where to print */
char* buf_end); /* in: buffer end */
FILE* file); /* in: file where to print */
/***********************************************************************
Prints info of the sync system. */
void
sync_print(
/*=======*/
char* buf, /* in/out: buffer where to print */
char* buf_end); /* in: buffer end */
FILE* file); /* in: file where to print */
#ifdef UNIV_DEBUG
/**********************************************************************
Checks that the mutex has been initialized. */
@ -136,6 +151,7 @@ ibool
mutex_validate(
/*===========*/
mutex_t* mutex);
#endif /* UNIV_DEBUG */
/**********************************************************************
Sets the mutex latching level field. */
@ -202,7 +218,7 @@ void
mutex_get_debug_info(
/*=================*/
mutex_t* mutex, /* in: mutex */
char** file_name, /* out: file where requested */
const char** file_name, /* out: file where requested */
ulint* line, /* out: line where requested */
os_thread_id_t* thread_id); /* out: id of the thread which owns
the mutex */

View File

@ -270,8 +270,9 @@ the magic number shows it valid. */
void
trx_sys_print_mysql_binlog_offset(void);
/*===================================*/
#ifdef UNIV_HOTBACKUP
/*********************************************************************
Prints to stdout the MySQL binlog info in the system header if the
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
void
@ -279,6 +280,7 @@ trx_sys_print_mysql_binlog_offset_from_page(
/*========================================*/
byte* page); /* in: buffer containing the trx system header page,
i.e., page number TRX_SYS_PAGE_NO in the tablespace */
#endif /* UNIV_HOTBACKUP */
/*********************************************************************
Prints to stderr the MySQL master log offset info in the trx system header if
the magic number shows it valid. */

View File

@ -280,8 +280,7 @@ own the kernel mutex. */
void
trx_print(
/*======*/
char* buf, /* in/out: buffer where to print, must be at least
800 bytes */
FILE* f, /* in: output stream */
trx_t* trx); /* in: transaction */
@ -422,6 +421,8 @@ struct trx_struct{
lock_t* auto_inc_lock; /* possible auto-inc lock reserved by
the transaction; note that it is also
in the lock list trx_locks */
ulint n_tables_locked;/* number of table locks reserved by
the transaction, stored in trx_locks */
UT_LIST_NODE_T(trx_t)
trx_list; /* list of transactions */
UT_LIST_NODE_T(trx_t)

View File

@ -235,21 +235,19 @@ Copies a string to a memory location, setting characters to lower case. */
void
ut_cpy_in_lower_case(
/*=================*/
char* dest, /* in: destination */
char* source, /* in: source */
ulint len); /* in: string length */
char* dest, /* in: destination */
const char* source, /* in: source */
ulint len); /* in: string length */
/****************************************************************
Compares two strings when converted to lower case. */
int
ut_cmp_in_lower_case(
/*=================*/
/* out: -1, 0, 1 if str1 < str2, str1 == str2,
str1 > str2, respectively */
char* str1, /* in: string1 */
char* str2, /* in: string2 */
ulint len); /* in: length of both strings */
/* out: -1, 0, 1 if str1 < str2, str1 == str2,
str1 > str2, respectively */
const char* str1, /* in: string1 */
const char* str2); /* in: string2 */
#ifndef UNIV_NONINL
#include "ut0byte.ic"

View File

@ -85,6 +85,39 @@ UNIV_INLINE
int
ut_strcmp(void* str1, void* str2);
/**************************************************************************
Determine the length of a string when it is quoted with ut_strcpyq(). */
UNIV_INLINE
ulint
ut_strlenq(
/*=======*/
/* out: length of the string when quoted */
const char* str, /* in: null-terminated string */
char q); /* in: the quote character */
/**************************************************************************
Make a quoted copy of a string. */
char*
ut_strcpyq(
/*=======*/
/* out: pointer to end of dest */
char* dest, /* in: output buffer */
char q, /* in: the quote character */
const char* src); /* in: null-terminated string */
/**************************************************************************
Make a quoted copy of a fixed-length string. */
char*
ut_memcpyq(
/*=======*/
/* out: pointer to end of dest */
char* dest, /* in: output buffer */
char q, /* in: the quote character */
const char* src, /* in: string to be quoted */
ulint len); /* in: length of src */
/**************************************************************************
Catenates two strings into newly allocated memory. The memory must be freed
using mem_free. */
@ -95,6 +128,7 @@ ut_str_catenate(
/* out, own: catenated null-terminated string */
char* str1, /* in: null-terminated string */
char* str2); /* in: null-terminated string */
/**************************************************************************
Return a copy of the given string. The returned string must be freed
using mem_free. */
@ -104,14 +138,6 @@ ut_strdup(
/*======*/
/* out, own: cnull-terminated string */
char* str); /* in: null-terminated string */
/**************************************************************************
Checks if a null-terminated string contains a certain character. */
ibool
ut_str_contains(
/*============*/
char* str, /* in: null-terminated string */
char c); /* in: character */
#ifndef UNIV_NONINL
#include "ut0mem.ic"

Some files were not shown because too many files have changed in this diff Show More