⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 metadata_charset.txt

📁 firebird最新源代码。firebird是一个全功能的,强大高效的,轻量级,免维护的数据库。它很容易让您从单用户、单数据库升级到企业级的应用。 一个firebird数据库服务器能够管理多个独立的数
💻 TXT
字号:
Firebird versions prior 2.1 has two problems related to character sets and metadata extraction:
 - 1. When creating/altering objects, it never transliterate metadata texts (procedures/triggers sources, descriptions, constraints/defaults texts, etc) from the client character set to the system (UNICODE_FSS) character set. It put raw bytes inside UNICODE_FSS columns.
 - 2. When reading text BLOBs, it doesn't transliterate from the BLOB character set to the client character set.

Note that even in version 2.1, the item 1 may occur if you create/alter objects connected with NONE or UNICODE_FSS character set using non-UNICODE_FSS data.

If you created metadata with non-ASCII letters, you need to repair your database to correctly read metadata after upgraded to 2.1.

For the following passes, the database should already be in ODS11.1.
Before do anything, make a copy of the database.

You should better connect each time in the database to do each pass.

Creating the procedures in the database
---------------------------------------
 - 1. isql database.fdb
 - 2. SQL> input 'misc/upgrade/metadata/metadata_charset_create.sql';

Checking your database
----------------------
 - 1. isql database.fdb
 - 2. SQL> select * from rdb$check_metadata;

The rdb$check_metadata procedure will return all objects that's touched by it.

If it doesn't raise an exception, seems your metadata is ok and you can go to "Removing the upgrade procedures" section.

Otherwise, the first bad object is the last one listed befored the exception.

To fix the metadata, you need to know in what character set the objects was been created.
The upgrade script will work correctly only if all your metadata was created using the same character set.

Fixing the metadata
-------------------
 - 1. isql database.fdb
 - 2. SQL> input 'misc/upgrade/metadata/metadata_charset_create.sql';
 - 3. SQL> select * from rdb$fix_metadata('WIN1252');  -- replace WIN1252 by your charset
 - 4. SQL> commit;

The rdb$fix_metadata procedure will return the same data as rdb$check_metadata, but will change the metadata texts.
It should be run once!
After this, you can remove the upgrade procedures.

Removing the upgrade procedures
-------------------------------
 - 1. isql database.fdb
 - 2. SQL> input 'misc/upgrade/metadata/metadata_charset_drop.sql';

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -