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
4ae5e616
Commit
4ae5e616
authored
Aug 30, 2006
by
tsmith@maint2.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge maint2.mysql.com:/data/localhome/tsmith/bk/bfx/41
into maint2.mysql.com:/data/localhome/tsmith/bk/41
parents
ccdda2e7
e80741b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
187 additions
and
184 deletions
+187
-184
BUILD/check-cpu
BUILD/check-cpu
+179
-176
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+7
-7
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+1
-1
No files found.
BUILD/check-cpu
View file @
4ae5e616
...
@@ -3,203 +3,206 @@
...
@@ -3,203 +3,206 @@
# Check cpu of current machine and find the
# Check cpu of current machine and find the
# best compiler optimization flags for gcc
# best compiler optimization flags for gcc
#
#
#
if
test
-r
/proc/cpuinfo
;
then
check_cpu
()
{
# on Linux (and others?) we can get detailed CPU information out of /proc
if
test
-r
/proc/cpuinfo
;
then
cpuinfo
=
"cat /proc/cpuinfo"
# on Linux (and others?) we can get detailed CPU information out of /proc
cpuinfo
=
"cat /proc/cpuinfo"
# detect CPU family
# detect CPU family
cpu_family
=
`
$cpuinfo
|
grep
'family'
|
cut
-d
':'
-f
2 |
cut
-d
' '
-f
2 |
head
-1
`
cpu_family
=
`
$cpuinfo
|
grep
'family'
|
cut
-d
':'
-f
2 |
cut
-d
' '
-f
2 |
head
-1
`
if
test
-z
"
$cpu_family
"
;
then
if
test
-z
"
$cpu_family
"
;
then
cpu_family
=
`
$cpuinfo
|
grep
'cpu'
|
cut
-d
':'
-f
2 |
cut
-d
' '
-f
2 |
head
-1
`
cpu_family
=
`
$cpuinfo
|
grep
'cpu'
|
cut
-d
':'
-f
2 |
cut
-d
' '
-f
2 |
head
-1
`
fi
fi
# detect CPU vendor and model
# detect CPU vendor and model
cpu_vendor
=
`
$cpuinfo
|
grep
'vendor_id'
|
cut
-d
':'
-f
2 |
cut
-d
' '
-f
2 |
head
-1
`
cpu_vendor
=
`
$cpuinfo
|
grep
'vendor_id'
|
cut
-d
':'
-f
2 |
cut
-d
' '
-f
2 |
head
-1
`
model_name
=
`
$cpuinfo
|
grep
'model name'
|
cut
-d
':'
-f
2 |
head
-1
`
model_name
=
`
$cpuinfo
|
grep
'model name'
|
cut
-d
':'
-f
2 |
head
-1
`
if
test
-z
"
$model_name
"
;
then
if
test
-z
"
$model_name
"
;
then
model_name
=
`
$cpuinfo
|
grep
'cpu model'
|
cut
-d
':'
-f
2 |
head
-1
`
model_name
=
`
$cpuinfo
|
grep
'cpu model'
|
cut
-d
':'
-f
2 |
head
-1
`
fi
fi
# fallback: get CPU model from uname output
if
test
-z
"
$model_name
"
;
then
model_name
=
`
uname
-m
`
fi
# fallback: get CPU model from uname output
# parse CPU flags
if
test
-z
"
$model_name
"
;
then
for
flag
in
`
$cpuinfo
|
grep
'^flags'
|
sed
-e
's/^flags.*: //'
`
;
do
model_name
=
`
uname
-m
`
eval
cpu_flag_
$flag
=
yes
done
else
# Fallback when there is no /proc/cpuinfo
case
"
`
uname
-s
`
"
in
FreeBSD|OpenBSD
)
cpu_family
=
`
uname
-m
`
;
model_name
=
`
sysctl
-n
hw.model
`
;;
Darwin
)
cpu_family
=
`
uname
-p
`
model_name
=
`
machine
`
;;
*
)
cpu_family
=
`
uname
-m
`
;
model_name
=
`
uname
-p
`
;
;;
esac
fi
fi
# parse CPU flags
# detect CPU shortname as used by gcc options
for
flag
in
`
$cpuinfo
|
grep
'^flags'
|
sed
-e
's/^flags.*: //'
`
;
do
# this list is not complete, feel free to add further entries
eval
cpu_flag_
$flag
=
yes
cpu_arg
=
""
done
case
"
$cpu_family
--
$model_name
"
in
else
# DEC Alpha
# Fallback when there is no /proc/cpuinfo
Alpha
*
EV6
*
)
case
"
`
uname
-s
`
"
in
cpu_arg
=
"ev6"
;
FreeBSD|OpenBSD
)
cpu_family
=
`
uname
-m
`
;
model_name
=
`
sysctl
-n
hw.model
`
;;
Darwin
)
cpu_family
=
`
uname
-p
`
model_name
=
`
machine
`
;;
;;
*
)
cpu_family
=
`
uname
-m
`
;
# Intel ia32
model_name
=
`
uname
-p
`
;
*
Xeon
*
)
# a Xeon is just another pentium4 ...
# ... unless it has the "lm" (long-mode) flag set,
# in that case it's a Xeon with EM64T support
if
[
-z
"
$cpu_flag_lm
"
]
;
then
cpu_arg
=
"pentium4"
;
else
cpu_arg
=
"nocona"
;
fi
;;
;;
esac
*
Pentium
*
4
*
Mobile
*
)
fi
cpu_arg
=
"pentium4m"
;
# detect CPU shortname as used by gcc options
# this list is not complete, feel free to add further entries
cpu_arg
=
""
case
"
$cpu_family
--
$model_name
"
in
# DEC Alpha
Alpha
*
EV6
*
)
cpu_arg
=
"ev6"
;
;;
;;
*
Pentium
*
4
*
)
# Intel ia32
*
Xeon
*
)
# a Xeon is just another pentium4 ...
# ... unless it has the "lm" (long-mode) flag set,
# in that case it's a Xeon with EM64T support
if
[
-z
"
$cpu_flag_lm
"
]
;
then
cpu_arg
=
"pentium4"
;
cpu_arg
=
"pentium4"
;
else
;;
cpu_arg
=
"nocona"
;
*
Pentium
*
III
*
Mobile
*
)
fi
cpu_arg
=
"pentium3m"
;
;;
*
Pentium
*
4
*
Mobile
*
)
cpu_arg
=
"pentium4m"
;
;;
*
Pentium
*
4
*
)
cpu_arg
=
"pentium4"
;
;;
;;
*
Pentium
*
III
*
Mobile
*
)
*
Pentium
*
III
*
)
cpu_arg
=
"pentium3m"
;
cpu_arg
=
"pentium3"
;
;;
*
Pentium
*
III
*
)
cpu_arg
=
"pentium3"
;
;;
*
Pentium
*
M
*
pro
*
)
cpu_arg
=
"pentium-m"
;
;;
*
Athlon
*
64
*
)
cpu_arg
=
"athlon64"
;
;;
;;
*
Athlon
*
)
*
Pentium
*
M
*
pro
*
)
cpu_arg
=
"athlon
"
;
cpu_arg
=
"pentium-m
"
;
;;
;;
*
Athlon
*
64
*
)
cpu_arg
=
"athlon64"
;
;;
*
Athlon
*
)
cpu_arg
=
"athlon"
;
;;
# Intel ia64
# Intel ia64
*
Itanium
*
)
*
Itanium
*
)
# Don't need to set any flags for itanium(at the moment)
# Don't need to set any flags for itanium(at the moment)
cpu_arg
=
""
;
cpu_arg
=
""
;
;;
;;
#
#
*
ppc
*
)
*
ppc
*
)
cpu_arg
=
'powerpc'
cpu_arg
=
'powerpc'
;;
;;
*
powerpc
*
)
*
powerpc
*
)
cpu_arg
=
'powerpc'
cpu_arg
=
'powerpc'
;;
;;
# unknown
# unknown
*
)
*
)
cpu_arg
=
""
;
cpu_arg
=
""
;
;;
;;
esac
esac
if
test
-z
"
$cpu_arg
"
;
then
if
test
-z
"
$cpu_arg
"
;
then
echo
"BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using."
echo
"BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using."
>
&2
check_cpu_cflags
=
""
return
fi
# different compiler versions have different option names
# for CPU specific command line options
if
test
-z
"
$CC
"
;
then
cc
=
"gcc"
;
else
cc
=
$CC
fi
cc_ver
=
`
$cc
--version
|
sed
1q
`
cc_verno
=
`
echo
$cc_ver
|
sed
-e
's/[^0-9. ]//g; s/^ *//g; s/ .*//g'
`
case
"
$cc_ver
--
$cc_verno
"
in
*
GCC
*
)
# different gcc backends (and versions) have different CPU flags
case
`
gcc
-dumpmachine
`
in
i?86-
*
)
case
"
$cc_verno
"
in
3.4
*
|
3.5
*
|
4.
*
)
check_cpu_args
=
'-mtune=$cpu_arg -march=$cpu_arg'
;;
*
)
check_cpu_args
=
'-mcpu=$cpu_arg -march=$cpu_arg'
;;
esac
;;
ppc-
*
)
check_cpu_args
=
'-mcpu=$cpu_arg -mtune=$cpu_arg'
;;
*
)
check_cpu_cflags
=
""
return
;;
esac
;;
2.95.
*
)
# GCC 2.95 doesn't expose its name in --version output
check_cpu_args
=
'-m$cpu_arg'
;;
*
)
check_cpu_cflags
=
""
check_cpu_cflags
=
""
return
return
;;
esac
# now we check whether the compiler really understands the cpu type
touch
__test.c
while
[
"
$cpu_arg
"
]
;
do
echo
-n
testing
$cpu_arg
"... "
# compile check
check_cpu_cflags
=
`
eval echo
$check_cpu_args
`
if
$cc
-c
$check_cpu_cflags
__test.c 2>/dev/null
;
then
echo
ok
break
;
fi
fi
echo
failed
# different compiler versions have different option names
check_cpu_cflags
=
""
# for CPU specific command line options
if
test
-z
"
$CC
"
;
then
cc
=
"gcc"
;
else
cc
=
$CC
fi
# if compile failed: check whether it supports a predecessor of this CPU
cc_ver
=
`
$cc
--version
|
sed
1q
`
# this list is not complete, feel free to add further entries
cc_verno
=
`
echo
$cc_ver
|
sed
-e
's/[^0-9. ]//g; s/^ *//g; s/ .*//g'
`
case
"
$cpu_arg
"
in
# Intel ia32
case
"
$cc_ver
--
$cc_verno
"
in
nocona
)
cpu_arg
=
pentium4
;;
*
GCC
*
)
prescott
)
cpu_arg
=
pentium4
;;
# different gcc backends (and versions) have different CPU flags
pentium4m
)
cpu_arg
=
pentium4
;;
case
`
gcc
-dumpmachine
`
in
pentium4
)
cpu_arg
=
pentium3
;;
i?86-
*
)
pentium3m
)
cpu_arg
=
pentium3
;;
case
"
$cc_verno
"
in
pentium3
)
cpu_arg
=
pentium2
;;
3.4
*
|
3.5
*
|
4.
*
)
pentium2
)
cpu_arg
=
pentiumpro
;;
check_cpu_args
=
'-mtune=$cpu_arg -march=$cpu_arg'
pentiumpro
)
cpu_arg
=
pentium
;;
;;
pentium
)
cpu_arg
=
i486
;;
*
)
i486
)
cpu_arg
=
i386
;;
check_cpu_args
=
'-mcpu=$cpu_arg -march=$cpu_arg'
;;
# power / powerPC
esac
7450
)
cpu_arg
=
7400
;;
;;
ppc-
*
)
*
)
cpu_arg
=
""
;;
check_cpu_args
=
'-mcpu=$cpu_arg -mtune=$cpu_arg'
;;
*
)
check_cpu_cflags
=
""
return
;;
esac
;;
2.95.
*
)
# GCC 2.95 doesn't expose its name in --version output
check_cpu_args
=
'-m$cpu_arg'
;;
*
)
check_cpu_cflags
=
""
return
;;
esac
esac
done
rm
__test.
*
# now we check whether the compiler really understands the cpu type
touch
__test.c
while
[
"
$cpu_arg
"
]
;
do
# FIXME: echo -n isn't portable - see contortions autoconf goes through
echo
-n
testing
$cpu_arg
"... "
>
&2
# compile check
check_cpu_cflags
=
`
eval echo
$check_cpu_args
`
if
$cc
-c
$check_cpu_cflags
__test.c 2>/dev/null
;
then
echo
ok
>
&2
break
;
fi
echo
failed
>
&2
check_cpu_cflags
=
""
# if compile failed: check whether it supports a predecessor of this CPU
# this list is not complete, feel free to add further entries
case
"
$cpu_arg
"
in
# Intel ia32
nocona
)
cpu_arg
=
pentium4
;;
prescott
)
cpu_arg
=
pentium4
;;
pentium4m
)
cpu_arg
=
pentium4
;;
pentium4
)
cpu_arg
=
pentium3
;;
pentium3m
)
cpu_arg
=
pentium3
;;
pentium3
)
cpu_arg
=
pentium2
;;
pentium2
)
cpu_arg
=
pentiumpro
;;
pentiumpro
)
cpu_arg
=
pentium
;;
pentium
)
cpu_arg
=
i486
;;
i486
)
cpu_arg
=
i386
;;
# power / powerPC
7450
)
cpu_arg
=
7400
;;
*
)
cpu_arg
=
""
;;
esac
done
rm
__test.
*
}
check_cpu
mysql-test/r/ctype_ucs.result
View file @
4ae5e616
...
@@ -726,26 +726,26 @@ drop table if exists bug20536;
...
@@ -726,26 +726,26 @@ drop table if exists bug20536;
set names latin1;
set names latin1;
create table bug20536 (id bigint not null auto_increment primary key, name
create table bug20536 (id bigint not null auto_increment primary key, name
varchar(255) character set ucs2 not null);
varchar(255) character set ucs2 not null);
insert into `bug20536` (`id`,`name`) values (1, _latin1 x'7465737431
1a
'), (2, "'test\\_2'");
insert into `bug20536` (`id`,`name`) values (1, _latin1 x'7465737431'), (2, "'test\\_2'");
select md5(name) from bug20536;
select md5(name) from bug20536;
md5(name)
md5(name)
3417d830fe24ffb2f81a28e54df2d1b3
f4b7ce8b45a20e3c4e84bef515d1525c
48d95db0d8305c2fe11548a3635c9385
48d95db0d8305c2fe11548a3635c9385
select sha1(name) from bug20536;
select sha1(name) from bug20536;
sha1(name)
sha1(name)
72228a6d56efb7a89a09543068d5d8fa4c330881
e0b52f38deddb9f9e8d5336b153592794cb49baf
677d4d505355eb5b0549b865fcae4b7f0c28aef5
677d4d505355eb5b0549b865fcae4b7f0c28aef5
select make_set(3, name, upper(name)) from bug20536;
select make_set(3, name, upper(name)) from bug20536;
make_set(3, name, upper(name))
make_set(3, name, upper(name))
test1
,TEST1
test1
,TEST1
'test\_2','TEST\_2'
'test\_2','TEST\_2'
select export_set(5, name, upper(name)) from bug20536;
select export_set(5, name, upper(name)) from bug20536;
export_set(5, name, upper(name))
export_set(5, name, upper(name))
test1
,TEST1,test1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1
test1
,TEST1,test1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2'
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2'
select export_set(5, name, upper(name), ",", 5) from bug20536;
select export_set(5, name, upper(name), ",", 5) from bug20536;
export_set(5, name, upper(name), ",", 5)
export_set(5, name, upper(name), ",", 5)
test1
,TEST1,test1,TEST1,TEST1
test1
,TEST1,test1,TEST1,TEST1
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2'
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2'
select password(name) from bug20536;
select password(name) from bug20536;
password(name)
password(name)
...
@@ -761,7 +761,7 @@ SA5pDi1UPZdys
...
@@ -761,7 +761,7 @@ SA5pDi1UPZdys
SA5pDi1UPZdys
SA5pDi1UPZdys
select quote(name) from bug20536;
select quote(name) from bug20536;
quote(name)
quote(name)
????????
??
????????
????????????????
????????????????
drop table bug20536;
drop table bug20536;
End of 4.1 tests
End of 4.1 tests
mysql-test/t/ctype_ucs.test
View file @
4ae5e616
...
@@ -475,7 +475,7 @@ drop table if exists bug20536;
...
@@ -475,7 +475,7 @@ drop table if exists bug20536;
set
names
latin1
;
set
names
latin1
;
create
table
bug20536
(
id
bigint
not
null
auto_increment
primary
key
,
name
create
table
bug20536
(
id
bigint
not
null
auto_increment
primary
key
,
name
varchar
(
255
)
character
set
ucs2
not
null
);
varchar
(
255
)
character
set
ucs2
not
null
);
insert
into
`bug20536`
(
`id`
,
`name`
)
values
(
1
,
_latin1
x
'7465737431
1a
'
),
(
2
,
"'test
\\
_2'"
);
insert
into
`bug20536`
(
`id`
,
`name`
)
values
(
1
,
_latin1
x
'7465737431'
),
(
2
,
"'test
\\
_2'"
);
select
md5
(
name
)
from
bug20536
;
select
md5
(
name
)
from
bug20536
;
select
sha1
(
name
)
from
bug20536
;
select
sha1
(
name
)
from
bug20536
;
select
make_set
(
3
,
name
,
upper
(
name
))
from
bug20536
;
select
make_set
(
3
,
name
,
upper
(
name
))
from
bug20536
;
...
...
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