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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ee3aca09
Commit
ee3aca09
authored
Jul 06, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jonas/src/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1-ndb
parents
6638f16b
f398a0bd
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
113 additions
and
107 deletions
+113
-107
client/mysqltest.c
client/mysqltest.c
+6
-65
include/config-win.h
include/config-win.h
+3
-0
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+1
-1
mysql-test/r/ctype_recoding.result
mysql-test/r/ctype_recoding.result
+25
-0
mysql-test/r/rpl_charset.result
mysql-test/r/rpl_charset.result
+5
-5
mysql-test/t/ctype_recoding.test
mysql-test/t/ctype_recoding.test
+19
-0
mysql-test/t/ps_3innodb.test
mysql-test/t/ps_3innodb.test
+2
-0
mysql-test/t/rpl_charset.test
mysql-test/t/rpl_charset.test
+1
-1
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+1
-1
scripts/mysql_fix_privilege_tables.sh
scripts/mysql_fix_privilege_tables.sh
+19
-5
sql/ha_berkeley.h
sql/ha_berkeley.h
+1
-2
sql/handler.h
sql/handler.h
+1
-1
sql/opt_sum.cc
sql/opt_sum.cc
+7
-6
sql/sql_class.cc
sql/sql_class.cc
+8
-6
sql/sql_select.cc
sql/sql_select.cc
+7
-4
sql/sql_show.cc
sql/sql_show.cc
+1
-1
sql/table.cc
sql/table.cc
+6
-9
No files found.
client/mysqltest.c
View file @
ee3aca09
...
@@ -224,7 +224,6 @@ Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
...
@@ -224,7 +224,6 @@ Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
Q_ENABLE_RESULT_LOG
,
Q_DISABLE_RESULT_LOG
,
Q_ENABLE_RESULT_LOG
,
Q_DISABLE_RESULT_LOG
,
Q_SERVER_START
,
Q_SERVER_STOP
,
Q_REQUIRE_MANAGER
,
Q_SERVER_START
,
Q_SERVER_STOP
,
Q_REQUIRE_MANAGER
,
Q_WAIT_FOR_SLAVE_TO_STOP
,
Q_WAIT_FOR_SLAVE_TO_STOP
,
Q_REQUIRE_VERSION
,
Q_REQUIRE_OS
,
Q_ENABLE_WARNINGS
,
Q_DISABLE_WARNINGS
,
Q_ENABLE_WARNINGS
,
Q_DISABLE_WARNINGS
,
Q_ENABLE_INFO
,
Q_DISABLE_INFO
,
Q_ENABLE_INFO
,
Q_DISABLE_INFO
,
Q_ENABLE_METADATA
,
Q_DISABLE_METADATA
,
Q_ENABLE_METADATA
,
Q_DISABLE_METADATA
,
...
@@ -297,8 +296,6 @@ const char *command_names[]=
...
@@ -297,8 +296,6 @@ const char *command_names[]=
"server_stop"
,
"server_stop"
,
"require_manager"
,
"require_manager"
,
"wait_for_slave_to_stop"
,
"wait_for_slave_to_stop"
,
"require_version"
,
"require_os"
,
"enable_warnings"
,
"enable_warnings"
,
"disable_warnings"
,
"disable_warnings"
,
"enable_info"
,
"enable_info"
,
...
@@ -818,63 +815,6 @@ int do_server_op(struct st_query* q,const char* op)
...
@@ -818,63 +815,6 @@ int do_server_op(struct st_query* q,const char* op)
}
}
#endif
#endif
int
do_require_version
(
struct
st_query
*
q
)
{
MYSQL
*
mysql
=
&
cur_con
->
mysql
;
MYSQL_RES
*
res
;
MYSQL_ROW
row
;
char
*
p
=
q
->
first_argument
,
*
ver_arg
;
uint
ver_arg_len
,
ver_len
;
LINT_INIT
(
res
);
if
(
!*
p
)
die
(
"Missing version argument in require_version
\n
"
);
ver_arg
=
p
;
while
(
*
p
&&
!
my_isspace
(
charset_info
,
*
p
))
p
++
;
*
p
=
0
;
ver_arg_len
=
p
-
ver_arg
;
if
(
mysql_query
(
mysql
,
"select version()"
)
||
!
(
res
=
mysql_store_result
(
mysql
)))
die
(
"Query failed while check server version: %s"
,
mysql_error
(
mysql
));
if
(
!
(
row
=
mysql_fetch_row
(
res
))
||
!
row
[
0
])
{
mysql_free_result
(
res
);
die
(
"Strange result from query while checking version"
);
}
ver_len
=
strlen
(
row
[
0
]);
if
(
ver_len
<
ver_arg_len
||
memcmp
(
row
[
0
],
ver_arg
,
ver_arg_len
))
{
mysql_free_result
(
res
);
abort_not_supported_test
();
}
mysql_free_result
(
res
);
return
0
;
}
int
do_require_os
(
struct
st_query
*
q
)
{
char
*
p
=
q
->
first_argument
,
*
os_arg
;
DBUG_ENTER
(
"do_require_os"
);
if
(
!*
p
)
die
(
"Missing version argument in require_os
\n
"
);
os_arg
=
p
;
while
(
*
p
&&
!
my_isspace
(
charset_info
,
*
p
))
p
++
;
*
p
=
0
;
if
(
strcmp
(
os_arg
,
"unix"
))
die
(
"For now only testing of os=unix is implemented
\n
"
);
#if defined(__NETWARE__) || defined(__WIN__) || defined(__OS2__)
abort_not_supported_test
();
#endif
DBUG_RETURN
(
0
);
}
int
do_source
(
struct
st_query
*
q
)
int
do_source
(
struct
st_query
*
q
)
{
{
char
*
p
=
q
->
first_argument
,
*
name
;
char
*
p
=
q
->
first_argument
,
*
name
;
...
@@ -1628,6 +1568,7 @@ int do_connect(struct st_query* q)
...
@@ -1628,6 +1568,7 @@ int do_connect(struct st_query* q)
if
(
opt_compress
)
if
(
opt_compress
)
mysql_options
(
&
next_con
->
mysql
,
MYSQL_OPT_COMPRESS
,
NullS
);
mysql_options
(
&
next_con
->
mysql
,
MYSQL_OPT_COMPRESS
,
NullS
);
mysql_options
(
&
next_con
->
mysql
,
MYSQL_OPT_LOCAL_INFILE
,
0
);
mysql_options
(
&
next_con
->
mysql
,
MYSQL_OPT_LOCAL_INFILE
,
0
);
mysql_options
(
&
next_con
->
mysql
,
MYSQL_SET_CHARSET_NAME
,
"latin1"
);
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
if
(
opt_use_ssl
)
if
(
opt_use_ssl
)
...
@@ -2692,6 +2633,8 @@ int main(int argc, char **argv)
...
@@ -2692,6 +2633,8 @@ int main(int argc, char **argv)
if
(
opt_compress
)
if
(
opt_compress
)
mysql_options
(
&
cur_con
->
mysql
,
MYSQL_OPT_COMPRESS
,
NullS
);
mysql_options
(
&
cur_con
->
mysql
,
MYSQL_OPT_COMPRESS
,
NullS
);
mysql_options
(
&
cur_con
->
mysql
,
MYSQL_OPT_LOCAL_INFILE
,
0
);
mysql_options
(
&
cur_con
->
mysql
,
MYSQL_OPT_LOCAL_INFILE
,
0
);
mysql_options
(
&
cur_con
->
mysql
,
MYSQL_SET_CHARSET_NAME
,
"latin1"
);
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
if
(
opt_use_ssl
)
if
(
opt_use_ssl
)
mysql_ssl_set
(
&
cur_con
->
mysql
,
opt_ssl_key
,
opt_ssl_cert
,
opt_ssl_ca
,
mysql_ssl_set
(
&
cur_con
->
mysql
,
opt_ssl_key
,
opt_ssl_cert
,
opt_ssl_ca
,
...
@@ -2736,8 +2679,6 @@ int main(int argc, char **argv)
...
@@ -2736,8 +2679,6 @@ int main(int argc, char **argv)
case
Q_SOURCE
:
do_source
(
q
);
break
;
case
Q_SOURCE
:
do_source
(
q
);
break
;
case
Q_SLEEP
:
do_sleep
(
q
,
0
);
break
;
case
Q_SLEEP
:
do_sleep
(
q
,
0
);
break
;
case
Q_REAL_SLEEP
:
do_sleep
(
q
,
1
);
break
;
case
Q_REAL_SLEEP
:
do_sleep
(
q
,
1
);
break
;
case
Q_REQUIRE_VERSION
:
do_require_version
(
q
);
break
;
case
Q_REQUIRE_OS
:
do_require_os
(
q
);
break
;
case
Q_WAIT_FOR_SLAVE_TO_STOP
:
do_wait_for_slave_to_stop
(
q
);
break
;
case
Q_WAIT_FOR_SLAVE_TO_STOP
:
do_wait_for_slave_to_stop
(
q
);
break
;
case
Q_REQUIRE_MANAGER
:
do_require_manager
(
q
);
break
;
case
Q_REQUIRE_MANAGER
:
do_require_manager
(
q
);
break
;
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
...
...
include/config-win.h
View file @
ee3aca09
...
@@ -348,6 +348,9 @@ inline double ulonglong2double(ulonglong value)
...
@@ -348,6 +348,9 @@ inline double ulonglong2double(ulonglong value)
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
#define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1
/* Define charsets you want */
/* Define charsets you want */
/* #undef HAVE_CHARSET_armscii8 */
/* #undef HAVE_CHARSET_armscii8 */
/* #undef HAVE_CHARSET_ascii */
/* #undef HAVE_CHARSET_ascii */
...
...
mysql-test/mysql-test-run.sh
View file @
ee3aca09
...
@@ -525,7 +525,7 @@ fi
...
@@ -525,7 +525,7 @@ fi
MYSQL_DUMP
=
"
$MYSQL_DUMP
--no-defaults -uroot --socket=
$MASTER_MYSOCK
--password=
$DBPASSWD
$EXTRA_MYSQLDUMP_OPT
"
MYSQL_DUMP
=
"
$MYSQL_DUMP
--no-defaults -uroot --socket=
$MASTER_MYSOCK
--password=
$DBPASSWD
$EXTRA_MYSQLDUMP_OPT
"
MYSQL_BINLOG
=
"
$MYSQL_BINLOG
--no-defaults --local-load=
$MYSQL_TMP_DIR
$EXTRA_MYSQLBINLOG_OPT
"
MYSQL_BINLOG
=
"
$MYSQL_BINLOG
--no-defaults --local-load=
$MYSQL_TMP_DIR
$EXTRA_MYSQLBINLOG_OPT
"
MYSQL_FIX_SYSTEM_TABLES
=
"
$MYSQL_FIX_SYSTEM_TABLES
--
host=localhost --port=
$MASTER_MYPORT
--socket=
$MASTER_MYSOCK
--user=root --password=
$DBPASSWD
--basedir=
$BASEDIR
--bindir=
$CLIENT_BINDIR
--verbose=1
"
MYSQL_FIX_SYSTEM_TABLES
=
"
$MYSQL_FIX_SYSTEM_TABLES
--
no-defaults --host=localhost --port=
$MASTER_MYPORT
--socket=
$MASTER_MYSOCK
--user=root --password=
$DBPASSWD
--basedir=
$BASEDIR
--bindir=
$CLIENT_BINDIR
--verbose
"
MYSQL
=
"
$MYSQL
--host=localhost --port=
$MASTER_MYPORT
--socket=
$MASTER_MYSOCK
--user=root --password=
$DBPASSWD
"
MYSQL
=
"
$MYSQL
--host=localhost --port=
$MASTER_MYPORT
--socket=
$MASTER_MYSOCK
--user=root --password=
$DBPASSWD
"
export
MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
export
MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
...
...
mysql-test/r/ctype_recoding.result
View file @
ee3aca09
...
@@ -111,3 +111,28 @@ SET character_set_connection=cp1251;
...
@@ -111,3 +111,28 @@ SET character_set_connection=cp1251;
SELECT hex('');
SELECT hex('');
hex('')
hex('')
F2E5F1F2
F2E5F1F2
USE test;
SET NAMES binary;
CREATE TABLE `тест` (`тест` int);
SHOW CREATE TABLE `тест`;
Table Create Table
тест CREATE TABLE `тест` (
`тест` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SET NAMES utf8;
SHOW CREATE TABLE `тест`;
Table Create Table
тест CREATE TABLE `тест` (
`тест` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `тест`;
SET NAMES binary;
SET character_set_connection=utf8;
SELECT 'тест' as s;
s
тест
SET NAMES utf8;
SET character_set_connection=binary;
SELECT 'тест' as s;
s
тест
mysql-test/r/rpl_charset.result
View file @
ee3aca09
...
@@ -25,19 +25,19 @@ test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
...
@@ -25,19 +25,19 @@ test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database test3;
show create database test3;
Database Create Database
Database Create Database
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
set @@collation_server=armscii_bin;
set @@collation_server=armscii
8
_bin;
drop database test3;
drop database test3;
create database test3;
create database test3;
--- --master--
--- --master--
show create database test3;
show create database test3;
Database Create Database
Database Create Database
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii_bin */
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii
8
_bin */
--- --slave--
--- --slave--
show create database test3;
show create database test3;
Database Create Database
Database Create Database
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii_bin */
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii
8
_bin */
use test2;
use test2;
create table t1 (a int auto_increment primary key, b varchar(100));
create table t1 (a int auto_increment primary key, b varchar(100));
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
...
@@ -51,7 +51,7 @@ insert into t1 (b) values(@@collation_connection);
...
@@ -51,7 +51,7 @@ insert into t1 (b) values(@@collation_connection);
select * from t1 order by a;
select * from t1 order by a;
a b
a b
1 armscii8
1 armscii8
2 armscii_bin
2 armscii
8
_bin
3 cp850
3 cp850
4 latin2
4 latin2
5 latin2_croatian_ci
5 latin2_croatian_ci
...
@@ -60,7 +60,7 @@ a b
...
@@ -60,7 +60,7 @@ a b
select * from test2.t1 order by a;
select * from test2.t1 order by a;
a b
a b
1 armscii8
1 armscii8
2 armscii_bin
2 armscii
8
_bin
3 cp850
3 cp850
4 latin2
4 latin2
5 latin2_croatian_ci
5 latin2_croatian_ci
...
...
mysql-test/t/ctype_recoding.test
View file @
ee3aca09
...
@@ -78,3 +78,22 @@ SET NAMES koi8r;
...
@@ -78,3 +78,22 @@ SET NAMES koi8r;
SELECT
hex
(
''
);
SELECT
hex
(
''
);
SET
character_set_connection
=
cp1251
;
SET
character_set_connection
=
cp1251
;
SELECT
hex
(
''
);
SELECT
hex
(
''
);
USE
test
;
# Bug#4417
# Check that identifiers and strings are not converted
# when the client character set is binary.
SET
NAMES
binary
;
CREATE
TABLE
`тест`
(
`тест`
int
);
SHOW
CREATE
TABLE
`тест`
;
SET
NAMES
utf8
;
SHOW
CREATE
TABLE
`тест`
;
DROP
TABLE
`тест`
;
SET
NAMES
binary
;
SET
character_set_connection
=
utf8
;
SELECT
'тест'
as
s
;
SET
NAMES
utf8
;
SET
character_set_connection
=
binary
;
SELECT
'тест'
as
s
;
mysql-test/t/ps_3innodb.test
View file @
ee3aca09
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
use
test
;
use
test
;
--
source
include
/
have_innodb
.
inc
let
$type
=
'InnoDB'
;
let
$type
=
'InnoDB'
;
--
source
include
/
ps_create
.
inc
--
source
include
/
ps_create
.
inc
--
source
include
/
ps_renew
.
inc
--
source
include
/
ps_renew
.
inc
...
...
mysql-test/t/rpl_charset.test
View file @
ee3aca09
...
@@ -26,7 +26,7 @@ show create database test2;
...
@@ -26,7 +26,7 @@ show create database test2;
show
create
database
test3
;
show
create
database
test3
;
connection
master
;
connection
master
;
set
@@
collation_server
=
armscii_bin
;
set
@@
collation_server
=
armscii
8
_bin
;
drop
database
test3
;
drop
database
test3
;
create
database
test3
;
create
database
test3
;
--
disable_query_log
--
disable_query_log
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
ee3aca09
...
@@ -1416,7 +1416,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
...
@@ -1416,7 +1416,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
s
=
SimpleProperties
::
pack
(
w
,
s
=
SimpleProperties
::
pack
(
w
,
&
tmpAttr
,
&
tmpAttr
,
DictTabInfo
::
AttributeMapping
,
DictTabInfo
::
AttributeMapping
,
DictTabInfo
::
Tabl
eMappingSize
,
true
);
DictTabInfo
::
Attribut
eMappingSize
,
true
);
w
.
add
(
DictTabInfo
::
AttributeEnd
,
1
);
w
.
add
(
DictTabInfo
::
AttributeEnd
,
1
);
}
}
...
...
scripts/mysql_fix_privilege_tables.sh
View file @
ee3aca09
...
@@ -17,8 +17,24 @@ bindir=""
...
@@ -17,8 +17,24 @@ bindir=""
file
=
mysql_fix_privilege_tables.sql
file
=
mysql_fix_privilege_tables.sql
# The following test is to make this script compatible with the 4.0 where
# the single argument could be a password
if
test
"$#"
=
1
then
case
"
$1
"
in
--
*
)
;;
*
)
old_style_password
=
"
$1
"
;
shift
;;
esac
fi
# The following code is almost identical to the code in mysql_install_db.sh
# The following code is almost identical to the code in mysql_install_db.sh
case
"
$1
"
in
--no-defaults
|
--defaults-file
=
*
|
--defaults-extra-file
=
*
)
defaults
=
"
$1
"
;
shift
;;
esac
parse_arguments
()
{
parse_arguments
()
{
# We only need to pass arguments through to the server if we don't
# We only need to pass arguments through to the server if we don't
# handle them here. So, we collect unrecognized options (passed on
# handle them here. So, we collect unrecognized options (passed on
...
@@ -36,7 +52,7 @@ parse_arguments() {
...
@@ -36,7 +52,7 @@ parse_arguments() {
--user
=
*
)
user
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--user
=
*
)
user
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--password
=
*
)
password
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--password
=
*
)
password
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--host
=
*
)
host
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--host
=
*
)
host
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--sql
|
--sql-only
)
sql_only
=
1
;;
--sql
|
--sql-only
)
sql_only
=
1
;;
--verbose
)
verbose
=
1
;;
--verbose
)
verbose
=
1
;;
--port
=
*
)
port
=
`
echo
"
$arg
"
|
sed
-e
"s;--port=;;"
`
;;
--port
=
*
)
port
=
`
echo
"
$arg
"
|
sed
-e
"s;--port=;;"
`
;;
--socket
=
*
)
socket
=
`
echo
"
$arg
"
|
sed
-e
"s;--socket=;;"
`
;;
--socket
=
*
)
socket
=
`
echo
"
$arg
"
|
sed
-e
"s;--socket=;;"
`
;;
...
@@ -47,7 +63,7 @@ parse_arguments() {
...
@@ -47,7 +63,7 @@ parse_arguments() {
then
then
# This sed command makes sure that any special chars are quoted,
# This sed command makes sure that any special chars are quoted,
# so the arg gets passed exactly to the server.
# so the arg gets passed exactly to the server.
args
=
"
$args
"
`
echo
"
$arg
"
|
sed
-e
's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'
`
args
=
"
$args
"
`
echo
"
$arg
"
|
sed
-e
's,\([^
=
a-zA-Z0-9_.-]\),\\\\\1,g'
`
fi
fi
;;
;;
esac
esac
...
@@ -94,11 +110,9 @@ else
...
@@ -94,11 +110,9 @@ else
fi
fi
fi
fi
# The following test is to make this script compatible with the 4.0 where
# the first argument was the password
if
test
-z
"
$password
"
if
test
-z
"
$password
"
then
then
password
=
`
echo
$args
|
sed
-e
's/ *//g'
`
password
=
$old_style_password
fi
fi
cmd
=
"
$bindir
/mysql -f --user=
$user
--host=
$host
"
cmd
=
"
$bindir
/mysql -f --user=
$user
--host=
$host
"
...
...
sql/ha_berkeley.h
View file @
ee3aca09
...
@@ -97,8 +97,7 @@ class ha_berkeley: public handler
...
@@ -97,8 +97,7 @@ class ha_berkeley: public handler
ulong
index_flags
(
uint
idx
,
uint
part
)
const
ulong
index_flags
(
uint
idx
,
uint
part
)
const
{
{
ulong
flags
=
HA_READ_NEXT
|
HA_READ_PREV
;
ulong
flags
=
HA_READ_NEXT
|
HA_READ_PREV
;
if
(
part
==
(
uint
)
~
0
||
if
(
table
->
key_info
[
idx
].
key_part
[
part
].
field
->
key_type
()
!=
HA_KEYTYPE_TEXT
)
table
->
key_info
[
idx
].
key_part
[
part
].
field
->
key_type
()
!=
HA_KEYTYPE_TEXT
)
flags
|=
HA_READ_ORDER
|
HA_KEYREAD_ONLY
|
HA_READ_RANGE
;
flags
|=
HA_READ_ORDER
|
HA_KEYREAD_ONLY
|
HA_READ_RANGE
;
return
flags
;
return
flags
;
}
}
...
...
sql/handler.h
View file @
ee3aca09
...
@@ -449,7 +449,7 @@ public:
...
@@ -449,7 +449,7 @@ public:
virtual
const
char
*
table_type
()
const
=
0
;
virtual
const
char
*
table_type
()
const
=
0
;
virtual
const
char
**
bas_ext
()
const
=
0
;
virtual
const
char
**
bas_ext
()
const
=
0
;
virtual
ulong
table_flags
(
void
)
const
=
0
;
virtual
ulong
table_flags
(
void
)
const
=
0
;
virtual
ulong
index_flags
(
uint
idx
,
uint
part
=
~
0
)
const
=
0
;
virtual
ulong
index_flags
(
uint
idx
,
uint
part
=
0
)
const
=
0
;
virtual
ulong
index_ddl_flags
(
KEY
*
wanted_index
)
const
virtual
ulong
index_ddl_flags
(
KEY
*
wanted_index
)
const
{
return
(
HA_DDL_SUPPORT
);
}
{
return
(
HA_DDL_SUPPORT
);
}
virtual
int
add_index
(
TABLE
*
table_arg
,
KEY
*
key_info
,
uint
num_of_keys
)
virtual
int
add_index
(
TABLE
*
table_arg
,
KEY
*
key_info
,
uint
num_of_keys
)
...
...
sql/opt_sum.cc
View file @
ee3aca09
...
@@ -638,15 +638,16 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
...
@@ -638,15 +638,16 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
keyinfo
!=
keyinfo_end
;
keyinfo
!=
keyinfo_end
;
keyinfo
++
,
idx
++
)
keyinfo
++
,
idx
++
)
{
{
if
(
!
(
table
->
file
->
index_flags
(
idx
)
&
HA_READ_ORDER
))
break
;
KEY_PART_INFO
*
part
,
*
part_end
;
KEY_PART_INFO
*
part
,
*
part_end
;
key_part_map
key_part_to_use
=
0
;
key_part_map
key_part_to_use
=
0
;
uint
jdx
=
0
;
for
(
part
=
keyinfo
->
key_part
,
part_end
=
part
+
keyinfo
->
key_parts
;
for
(
part
=
keyinfo
->
key_part
,
part_end
=
part
+
keyinfo
->
key_parts
;
part
!=
part_end
;
part
!=
part_end
;
part
++
,
key_part_to_use
=
(
key_part_to_use
<<
1
)
|
1
)
part
++
,
jdx
++
,
key_part_to_use
=
(
key_part_to_use
<<
1
)
|
1
)
{
{
if
(
!
(
table
->
file
->
index_flags
(
idx
,
jdx
)
&
HA_READ_ORDER
))
return
0
;
if
(
field
->
eq
(
part
->
field
))
if
(
field
->
eq
(
part
->
field
))
{
{
ref
->
key
=
idx
;
ref
->
key
=
idx
;
...
...
sql/sql_class.cc
View file @
ee3aca09
...
@@ -533,21 +533,23 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
...
@@ -533,21 +533,23 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
return
FALSE
;
return
FALSE
;
}
}
/*
/*
Update some cache variables when character set changes
Update some cache variables when character set changes
*/
*/
void
THD
::
update_charset
()
void
THD
::
update_charset
()
{
{
charset_is_system_charset
=
my_charset_same
(
charset
(),
system_charset_info
);
uint32
not_used
;
charset_is_collation_connection
=
my_charset_same
(
charset
(),
charset_is_system_charset
=
!
String
::
needs_conversion
(
0
,
charset
(),
variables
.
system_charset_info
,
collation_connection
);
&
not_used
);
charset_is_collation_connection
=
!
String
::
needs_conversion
(
0
,
charset
(),
variables
.
collation_connection
,
&
not_used
);
}
}
/* routings to adding tables to list of changed in transaction tables */
/* routings to adding tables to list of changed in transaction tables */
inline
static
void
list_include
(
CHANGED_TABLE_LIST
**
prev
,
inline
static
void
list_include
(
CHANGED_TABLE_LIST
**
prev
,
...
...
sql/sql_select.cc
View file @
ee3aca09
...
@@ -2825,7 +2825,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
...
@@ -2825,7 +2825,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
Set tmp to (previous record count) * (records / combination)
Set tmp to (previous record count) * (records / combination)
*/
*/
if
((
found_part
&
1
)
&&
if
((
found_part
&
1
)
&&
(
!
(
table
->
file
->
index_flags
(
key
)
&
HA_ONLY_WHOLE_INDEX
)
||
(
!
(
table
->
file
->
index_flags
(
key
,
0
)
&
HA_ONLY_WHOLE_INDEX
)
||
found_part
==
PREV_BITS
(
uint
,
keyinfo
->
key_parts
)))
found_part
==
PREV_BITS
(
uint
,
keyinfo
->
key_parts
)))
{
{
max_key_part
=
max_part_bit
(
found_part
);
max_key_part
=
max_part_bit
(
found_part
);
...
@@ -7171,7 +7171,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
...
@@ -7171,7 +7171,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
*/
*/
if
(
!
select
->
quick
->
reverse_sorted
())
if
(
!
select
->
quick
->
reverse_sorted
())
{
{
if
(
!
(
table
->
file
->
index_flags
(
ref_key
)
&
HA_READ_PREV
))
// here used_key_parts >0
if
(
!
(
table
->
file
->
index_flags
(
ref_key
,
used_key_parts
-
1
)
&
HA_READ_PREV
))
DBUG_RETURN
(
0
);
// Use filesort
DBUG_RETURN
(
0
);
// Use filesort
// ORDER BY range_key DESC
// ORDER BY range_key DESC
QUICK_SELECT_DESC
*
tmp
=
new
QUICK_SELECT_DESC
(
select
->
quick
,
QUICK_SELECT_DESC
*
tmp
=
new
QUICK_SELECT_DESC
(
select
->
quick
,
...
@@ -7193,7 +7195,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
...
@@ -7193,7 +7195,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
Use a traversal function that starts by reading the last row
Use a traversal function that starts by reading the last row
with key part (A) and then traverse the index backwards.
with key part (A) and then traverse the index backwards.
*/
*/
if
(
!
(
table
->
file
->
index_flags
(
ref_key
)
&
HA_READ_PREV
))
if
(
!
(
table
->
file
->
index_flags
(
ref_key
,
used_key_parts
-
1
)
&
HA_READ_PREV
))
DBUG_RETURN
(
0
);
// Use filesort
DBUG_RETURN
(
0
);
// Use filesort
tab
->
read_first_record
=
join_read_last_key
;
tab
->
read_first_record
=
join_read_last_key
;
tab
->
read_record
.
read_record
=
join_read_prev_same
;
tab
->
read_record
.
read_record
=
join_read_prev_same
;
...
...
sql/sql_show.cc
View file @
ee3aca09
...
@@ -995,7 +995,7 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
...
@@ -995,7 +995,7 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
str
=
(
key_part
->
field
?
key_part
->
field
->
field_name
:
str
=
(
key_part
->
field
?
key_part
->
field
->
field_name
:
"?unknown field?"
);
"?unknown field?"
);
protocol
->
store
(
str
,
system_charset_info
);
protocol
->
store
(
str
,
system_charset_info
);
if
(
table
->
file
->
index_flags
(
i
)
&
HA_READ_ORDER
)
if
(
table
->
file
->
index_flags
(
i
,
j
)
&
HA_READ_ORDER
)
protocol
->
store
(((
key_part
->
key_part_flag
&
HA_REVERSE_SORT
)
?
protocol
->
store
(((
key_part
->
key_part_flag
&
HA_REVERSE_SORT
)
?
"D"
:
"A"
),
1
,
system_charset_info
);
"D"
:
"A"
),
1
,
system_charset_info
);
else
else
...
...
sql/table.cc
View file @
ee3aca09
...
@@ -167,9 +167,9 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
...
@@ -167,9 +167,9 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
outparam
->
keys
=
keys
=
disk_buff
[
0
];
outparam
->
keys
=
keys
=
disk_buff
[
0
];
outparam
->
key_parts
=
key_parts
=
disk_buff
[
1
];
outparam
->
key_parts
=
key_parts
=
disk_buff
[
1
];
}
}
outparam
->
keys_for_keyread
.
init
(
keys
);
outparam
->
keys_for_keyread
.
init
(
0
);
outparam
->
keys_in_use
.
init
(
keys
);
outparam
->
keys_in_use
.
init
(
keys
);
outparam
->
read_only_keys
.
init
(
0
);
outparam
->
read_only_keys
.
init
(
keys
);
outparam
->
quick_keys
.
init
();
outparam
->
quick_keys
.
init
();
outparam
->
used_keys
.
init
();
outparam
->
used_keys
.
init
();
outparam
->
keys_in_use_for_query
.
init
();
outparam
->
keys_in_use_for_query
.
init
();
...
@@ -500,13 +500,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
...
@@ -500,13 +500,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if
(
outparam
->
key_info
[
key
].
flags
&
HA_FULLTEXT
)
if
(
outparam
->
key_info
[
key
].
flags
&
HA_FULLTEXT
)
outparam
->
key_info
[
key
].
algorithm
=
HA_KEY_ALG_FULLTEXT
;
outparam
->
key_info
[
key
].
algorithm
=
HA_KEY_ALG_FULLTEXT
;
/* This has to be done after the above fulltext correction */
if
(
!
(
outparam
->
file
->
index_flags
(
key
)
&
HA_KEYREAD_ONLY
))
{
outparam
->
read_only_keys
.
set_bit
(
key
);
outparam
->
keys_for_keyread
.
clear_bit
(
key
);
}
if
(
primary_key
>=
MAX_KEY
&&
(
keyinfo
->
flags
&
HA_NOSAME
))
if
(
primary_key
>=
MAX_KEY
&&
(
keyinfo
->
flags
&
HA_NOSAME
))
{
{
/*
/*
...
@@ -577,7 +570,11 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
...
@@ -577,7 +570,11 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
!
(
field
->
flags
&
BLOB_FLAG
))
!
(
field
->
flags
&
BLOB_FLAG
))
{
{
if
(
outparam
->
file
->
index_flags
(
key
,
i
)
&
HA_KEYREAD_ONLY
)
if
(
outparam
->
file
->
index_flags
(
key
,
i
)
&
HA_KEYREAD_ONLY
)
{
outparam
->
read_only_keys
.
clear_bit
(
key
);
outparam
->
keys_for_keyread
.
set_bit
(
key
);
field
->
part_of_key
.
set_bit
(
key
);
field
->
part_of_key
.
set_bit
(
key
);
}
if
(
outparam
->
file
->
index_flags
(
key
,
i
)
&
HA_READ_ORDER
)
if
(
outparam
->
file
->
index_flags
(
key
,
i
)
&
HA_READ_ORDER
)
field
->
part_of_sortkey
.
set_bit
(
key
);
field
->
part_of_sortkey
.
set_bit
(
key
);
}
}
...
...
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