Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e8687113
Commit
e8687113
authored
Feb 14, 2005
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB: Small improvements to earlier patch (fix Bug #7350 better),
suggested in review by Heikki.
parent
e7c10dd2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
8 deletions
+45
-8
innobase/include/data0type.h
innobase/include/data0type.h
+7
-1
innobase/include/data0type.ic
innobase/include/data0type.ic
+36
-5
sql/ha_innodb.cc
sql/ha_innodb.cc
+2
-2
No files found.
innobase/include/data0type.h
View file @
e8687113
...
...
@@ -370,7 +370,13 @@ dtype_print(
/*========*/
dtype_t
*
type
);
/* in: type */
/* Structure for an SQL data type */
/* Structure for an SQL data type.
If you add fields to this structure, be sure to initialize them everywhere.
This structure is initialized in the following functions:
dtype_set()
dtype_read_for_order_and_null_size()
dtype_new_read_for_order_and_null_size()
sym_tab_add_null_lit() */
struct
dtype_struct
{
ulint
mtype
;
/* main data type */
...
...
innobase/include/data0type.ic
View file @
e8687113
...
...
@@ -15,8 +15,8 @@ NOTE: the prototype of this function is copied from ha_innodb.cc! If you change
this function, you MUST change also the prototype here! */
extern
void
innobase_get_
mb_cset
(
/*=================*/
innobase_get_
cset_width
(
/*=================
===
*/
ulint cset, /* in: MySQL charset-collation code */
ulint* mbminlen, /* out: minimum length of a char (in bytes) */
ulint* mbmaxlen); /* out: maximum length of a char (in bytes) */
...
...
@@ -42,7 +42,7 @@ dtype_set_mblen(
{
ut_ad(type);
if (dtype_is_string_type(type->mtype)) {
innobase_get_
mb_cset
(dtype_get_charset_coll(type->prtype),
innobase_get_
cset_width
(dtype_get_charset_coll(type->prtype),
&type->mbminlen, &type->mbmaxlen);
ut_ad(type->mbminlen <= type->mbmaxlen);
} else {
...
...
@@ -355,9 +355,40 @@ dtype_get_fixed_size(
case DATA_FLOAT:
case DATA_DOUBLE:
case DATA_MYSQL:
if ((type->prtype & DATA_BINARY_TYPE)
|| type->mbminlen == type->mbmaxlen) {
if (type->prtype & DATA_BINARY_TYPE) {
return(dtype_get_len(type));
} else {
/* We play it safe here and ask MySQL for
mbminlen and mbmaxlen. Although
type->mbminlen and type->mbmaxlen are
initialized if and only if type->prtype
is (in one of the 3 functions in this file),
it could be that none of these functions
has been called. */
ulint mbminlen, mbmaxlen;
innobase_get_cset_width(
dtype_get_charset_coll(type->prtype),
&mbminlen, &mbmaxlen);
if (type->mbminlen != mbminlen
|| type->mbmaxlen != mbmaxlen) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: "
"mbminlen=%lu, "
"mbmaxlen=%lu, "
"type->mbminlen=%lu, "
"type->mbmaxlen=%lu\n",
(ulong) mbminlen,
(ulong) mbmaxlen,
(ulong) type->mbminlen,
(ulong) type->mbmaxlen);
}
if (mbminlen == mbmaxlen) {
return(dtype_get_len(type));
}
}
/* fall through for variable-length charsets */
case DATA_VARCHAR:
...
...
sql/ha_innodb.cc
View file @
e8687113
...
...
@@ -541,8 +541,8 @@ NOTE that the exact prototype of this function has to be in
/innobase/data/data0type.ic! */
extern
"C"
void
innobase_get_
mb_cset
(
/*=================*/
innobase_get_
cset_width
(
/*=================
===
*/
ulint
cset
,
/* in: MySQL charset-collation code */
ulint
*
mbminlen
,
/* out: minimum length of a char (in bytes) */
ulint
*
mbmaxlen
)
/* out: maximum length of a char (in bytes) */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment