diff options
author | bar@mysql.com <> | 2005-12-31 09:01:26 +0400 |
---|---|---|
committer | bar@mysql.com <> | 2005-12-31 09:01:26 +0400 |
commit | 6ff211329f8c513c2b8ec7e3ef1652e1ff7d7b8c (patch) | |
tree | 6a3476c826545341821fbccb1f42ba381c5ca30a /sql/discover.cc | |
parent | 83d8979ca28da67a054fff6c8f9e127e38f26ecb (diff) | |
download | mariadb-git-6ff211329f8c513c2b8ec7e3ef1652e1ff7d7b8c.tar.gz |
WL#1324 table name to file name encoding
- Encoding itself, implemented as a charset
"filename". Originally planned to use '.'
as an escape character, but now changed to '@'
for two reasons: "ls" does not return
file names starting with '.' considering them
as a kind of hidden files; some platforms
do not allow several dots in a file name.
- replacing many calls of my_snprintf() and
strnxmov() to the new build_table_filename().
- Adding MY_APPEND_EXT mysys flag, to append
an extention rather that replace it.
- Replacing all numeric constants in fn_format
flag arguments to their mysys definitions, e.g.
MY_UNPACK_FILENAME,
- Predictability in several function/methods:
when a table name can appear with or withot .frm
extension. Some functions/methods were changed
so accept names strictly with .frm, other - strictly
without .frm extensions. Several DBUG_ASSERTs were
added to check whether an extension is passed.
Many files:
table name to file name encoding
mysql_priv.h:
Prototypes for new table name encoding tools.
ctype-utf8.c:
Implementing "filename" charset for
table name to file name encoding.
row0mysql.c:
Fixing table name prefix.
mf_format.c:
Adding MY_APPEND_EXT processing.
Many files:
Fixing tests.
my_sys.h:
Adding new flag to append rather than replace an extension.
m_ctype.h:
Adding "filename" charset definition.
Diffstat (limited to 'sql/discover.cc')
-rw-r--r-- | sql/discover.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/discover.cc b/sql/discover.cc index 1251055c70e..2a3da55f154 100644 --- a/sql/discover.cc +++ b/sql/discover.cc @@ -55,7 +55,8 @@ int readfrm(const char *name, *frmdata= NULL; // In case of errors *len= 0; error= 1; - if ((file=my_open(fn_format(index_file,name,"",reg_ext,4), + if ((file=my_open(fn_format(index_file,name,"",reg_ext, + MY_UNPACK_FILENAME|MY_APPEND_EXT), O_RDONLY | O_SHARE, MYF(0))) < 0) goto err_end; @@ -112,7 +113,8 @@ int writefrm(const char *name, const void *frmdata, uint len) //DBUG_DUMP("frmdata", (char*)frmdata, len); error= 0; - if ((file=my_create(fn_format(index_file,name,"",reg_ext,4), + if ((file=my_create(fn_format(index_file,name,"",reg_ext, + MY_UNPACK_FILENAME|MY_APPEND_EXT), CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0) { if (my_write(file,(byte*)frmdata,len,MYF(MY_WME | MY_NABP))) |