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
8bef3771
Commit
8bef3771
authored
Dec 11, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
parents
2bb6ecf1
9ca9fc22
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
499 additions
and
329 deletions
+499
-329
Docs/manual.texi
Docs/manual.texi
+12
-9
client/mysqltest.c
client/mysqltest.c
+10
-6
innobase/os/os0file.c
innobase/os/os0file.c
+15
-18
myisam/mi_check.c
myisam/mi_check.c
+30
-18
myisam/mi_dynrec.c
myisam/mi_dynrec.c
+8
-4
myisam/myisamdef.h
myisam/myisamdef.h
+1
-1
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+299
-243
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+0
-6
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+24
-1
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+5
-2
sql/sql_cache.cc
sql/sql_cache.cc
+3
-1
sql/sql_select.cc
sql/sql_select.cc
+11
-8
sql/sql_yacc.yy
sql/sql_yacc.yy
+9
-12
tests/myisam-big-rows.tst
tests/myisam-big-rows.tst
+72
-0
No files found.
Docs/manual.texi
View file @
8bef3771
...
@@ -13637,7 +13637,6 @@ connection between a MySQL server and a MySQL client.
...
@@ -13637,7 +13637,6 @@ connection between a MySQL server and a MySQL client.
If you are using MySQL 4.0, you can also use internal openssl support.
If you are using MySQL 4.0, you can also use internal openssl support.
@xref{Secure connections}.
@xref{Secure connections}.
To make a MySQL system secure, you should strongly consider the
To make a MySQL system secure, you should strongly consider the
following suggestions:
following suggestions:
...
@@ -13653,8 +13652,7 @@ this:
...
@@ -13653,8 +13652,7 @@ this:
@example
@example
shell> mysql -u root mysql
shell> mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('new_password')
mysql> UPDATE user SET Password=PASSWORD('new_password') WHERE user='root';
WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> FLUSH PRIVILEGES;
@end example
@end example
...
@@ -15396,17 +15394,17 @@ password using the @code{PASSWORD()} function):
...
@@ -15396,17 +15394,17 @@ password using the @code{PASSWORD()} function):
@example
@example
shell> mysql -u root mysql
shell> mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('new_password')
mysql> SET PASSWORD FOR root@@localhost=PASSWORD('new_password');
WHERE user='root';
mysql> FLUSH PRIVILEGES;
@end example
@end example
You can, in MySQL Version 3.22 and above, use the @code{SET PASSWORD}
If you know what you are doing, you can also directly manipulate the
statement
:
privilege tables
:
@example
@example
shell> mysql -u root mysql
shell> mysql -u root mysql
mysql> SET PASSWORD FOR root=PASSWORD('new_password');
mysql> UPDATE user SET Password=PASSWORD('new_password')
WHERE user='root';
mysql> FLUSH PRIVILEGES;
@end example
@end example
Another way to set the password is by using the @code{mysqladmin} command:
Another way to set the password is by using the @code{mysqladmin} command:
...
@@ -46287,6 +46285,9 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
...
@@ -46287,6 +46285,9 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@itemize @bullet
@item
@item
Changed @code{SELECT ... IN SHARE MODE} to
@code{SELECT .. LOCK IN SHARE MODE} (as in MySQL 3.23).
@item
A new query cache to cache results from identical @code{SELECT} queries.
A new query cache to cache results from identical @code{SELECT} queries.
@item
@item
Fixed core dump bug on 64 bit machines when it got a wrong communication
Fixed core dump bug on 64 bit machines when it got a wrong communication
...
@@ -46540,6 +46541,8 @@ not yet 100% confident in this code.
...
@@ -46540,6 +46541,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.47
@appendixsubsec Changes in release 3.23.47
@itemize @bullet
@itemize @bullet
@item
@item
Fixed that @code{GROUP BY expr DESC} works.
@item
Fixed bug when using @code{t1 LEFT JOIN t2 ON t2.key=constant}.
Fixed bug when using @code{t1 LEFT JOIN t2 ON t2.key=constant}.
@item
@item
@code{mysqlconfig} now also work with binary (relocated) distributions.
@code{mysqlconfig} now also work with binary (relocated) distributions.
client/mysqltest.c
View file @
8bef3771
...
@@ -75,17 +75,21 @@
...
@@ -75,17 +75,21 @@
#define MAX_EXPECTED_ERRORS 10
#define MAX_EXPECTED_ERRORS 10
#define QUERY_SEND 1
#define QUERY_SEND 1
#define QUERY_REAP 2
#define QUERY_REAP 2
#define CON_RETRY_SLEEP 1
/* how long to sleep before trying to connect again*/
#define MAX_CON_TRIES 2
/* sometimes in a test the client starts before
* the server - to solve the problem, we try again
* after some sleep if connection fails the first
* time */
#ifndef MYSQL_MANAGER_PORT
#ifndef MYSQL_MANAGER_PORT
#define MYSQL_MANAGER_PORT 23546
#define MYSQL_MANAGER_PORT 23546
#endif
#endif
/*
Sometimes in a test the client starts before
the server - to solve the problem, we try again
after some sleep if connection fails the first
time
*/
#define CON_RETRY_SLEEP 2
#define MAX_CON_TRIES 5
enum
{
OPT_MANAGER_USER
=
256
,
OPT_MANAGER_HOST
,
OPT_MANAGER_PASSWD
,
enum
{
OPT_MANAGER_USER
=
256
,
OPT_MANAGER_HOST
,
OPT_MANAGER_PASSWD
,
OPT_MANAGER_PORT
,
OPT_MANAGER_WAIT_TIMEOUT
};
OPT_MANAGER_PORT
,
OPT_MANAGER_WAIT_TIMEOUT
};
static
int
record
=
0
,
verbose
=
0
,
silent
=
0
,
opt_sleep
=
0
;
static
int
record
=
0
,
verbose
=
0
,
silent
=
0
,
opt_sleep
=
0
;
static
char
*
db
=
0
,
*
pass
=
0
;
static
char
*
db
=
0
,
*
pass
=
0
;
...
...
innobase/os/os0file.c
View file @
8bef3771
...
@@ -457,14 +457,13 @@ os_file_get_size(
...
@@ -457,14 +457,13 @@ os_file_get_size(
offs
=
lseek
(
file
,
0
,
SEEK_END
);
offs
=
lseek
(
file
,
0
,
SEEK_END
);
if
(
sizeof
(
off_t
)
>
4
)
{
#if SIZEOF_OFF_T > 4
*
size
=
(
ulint
)(
offs
&
0xFFFFFFFF
);
*
size
=
(
ulint
)(
offs
&
0xFFFFFFFF
);
*
size_high
=
(
ulint
)(
offs
>>
32
);
*
size_high
=
(
ulint
)(
offs
>>
32
);
}
else
{
#else
*
size
=
(
ulint
)
offs
;
*
size
=
(
ulint
)
offs
;
*
size_high
=
0
;
*
size_high
=
0
;
}
#endif
return
(
TRUE
);
return
(
TRUE
);
#endif
#endif
}
}
...
@@ -614,18 +613,16 @@ os_file_pread(
...
@@ -614,18 +613,16 @@ os_file_pread(
/* If off_t is > 4 bytes in size, then we assume we can pass a
/* If off_t is > 4 bytes in size, then we assume we can pass a
64-bit address */
64-bit address */
if
(
sizeof
(
off_t
)
>
4
)
{
#if SIZEOF_OFF_T > 4
offs
=
(
off_t
)
offset
+
(((
off_t
)
offset_high
)
<<
32
);
offs
=
(
off_t
)
offset
+
(((
off_t
)
offset_high
)
<<
32
);
#else
}
else
{
offs
=
(
off_t
)
offset
;
offs
=
(
off_t
)
offset
;
if
(
offset_high
>
0
)
{
if
(
offset_high
>
0
)
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"InnoDB: Error: file read at offset > 4 GB
\n
"
);
"InnoDB: Error: file read at offset > 4 GB
\n
"
);
}
}
}
#endif
os_n_file_reads
++
;
os_n_file_reads
++
;
#ifdef HAVE_PREAD
#ifdef HAVE_PREAD
...
...
myisam/mi_check.c
View file @
8bef3771
...
@@ -1288,8 +1288,6 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
...
@@ -1288,8 +1288,6 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
my_close
(
info
->
dfile
,
MYF
(
0
));
my_close
(
info
->
dfile
,
MYF
(
0
));
info
->
dfile
=
new_file
;
info
->
dfile
=
new_file
;
info
->
state
->
data_file_length
=
sort_info
->
filepos
;
info
->
state
->
data_file_length
=
sort_info
->
filepos
;
/* Only whole records */
share
->
state
.
split
=
info
->
state
->
records
+
info
->
state
->
del
;
share
->
state
.
version
=
(
ulong
)
time
((
time_t
*
)
0
);
/* Force reopen */
share
->
state
.
version
=
(
ulong
)
time
((
time_t
*
)
0
);
/* Force reopen */
}
}
else
else
...
@@ -1962,7 +1960,6 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
...
@@ -1962,7 +1960,6 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
share
->
state
.
state
.
data_file_length
=
info
->
state
->
data_file_length
share
->
state
.
state
.
data_file_length
=
info
->
state
->
data_file_length
=
sort_info
->
filepos
;
=
sort_info
->
filepos
;
/* Only whole records */
/* Only whole records */
share
->
state
.
split
=
info
->
state
->
records
+
info
->
state
->
del
;
share
->
state
.
version
=
(
ulong
)
time
((
time_t
*
)
0
);
share
->
state
.
version
=
(
ulong
)
time
((
time_t
*
)
0
);
my_close
(
info
->
dfile
,
MYF
(
0
));
my_close
(
info
->
dfile
,
MYF
(
0
));
info
->
dfile
=
new_file
;
info
->
dfile
=
new_file
;
...
@@ -2183,9 +2180,11 @@ static int sort_get_next_record(SORT_INFO *sort_info)
...
@@ -2183,9 +2180,11 @@ static int sort_get_next_record(SORT_INFO *sort_info)
}
}
sort_info
->
start_recpos
=
sort_info
->
pos
;
sort_info
->
start_recpos
=
sort_info
->
pos
;
if
(
!
sort_info
->
fix_datafile
)
if
(
!
sort_info
->
fix_datafile
)
{
sort_info
->
filepos
=
sort_info
->
pos
;
sort_info
->
filepos
=
sort_info
->
pos
;
share
->
state
.
split
++
;
}
sort_info
->
max_pos
=
(
sort_info
->
pos
+=
share
->
base
.
pack_reclength
);
sort_info
->
max_pos
=
(
sort_info
->
pos
+=
share
->
base
.
pack_reclength
);
share
->
state
.
split
++
;
if
(
*
sort_info
->
record
)
if
(
*
sort_info
->
record
)
{
{
if
(
param
->
calc_checksum
)
if
(
param
->
calc_checksum
)
...
@@ -2356,7 +2355,8 @@ static int sort_get_next_record(SORT_INFO *sort_info)
...
@@ -2356,7 +2355,8 @@ static int sort_get_next_record(SORT_INFO *sort_info)
continue
;
continue
;
}
}
share
->
state
.
split
++
;
if
(
!
sort_info
->
fix_datafile
&&
(
b_type
&
BLOCK_DELETED
))
share
->
state
.
split
++
;
if
(
!
found_record
++
)
if
(
!
found_record
++
)
{
{
sort_info
->
find_length
=
left_length
=
block_info
.
rec_len
;
sort_info
->
find_length
=
left_length
=
block_info
.
rec_len
;
...
@@ -2494,10 +2494,12 @@ static int sort_get_next_record(SORT_INFO *sort_info)
...
@@ -2494,10 +2494,12 @@ static int sort_get_next_record(SORT_INFO *sort_info)
}
}
info
->
checksum
=
mi_checksum
(
info
,
sort_info
->
record
);
info
->
checksum
=
mi_checksum
(
info
,
sort_info
->
record
);
if
(
!
sort_info
->
fix_datafile
)
if
(
!
sort_info
->
fix_datafile
)
{
sort_info
->
filepos
=
sort_info
->
pos
;
sort_info
->
filepos
=
sort_info
->
pos
;
share
->
state
.
split
++
;
}
sort_info
->
max_pos
=
(
sort_info
->
pos
=
block_info
.
filepos
+
sort_info
->
max_pos
=
(
sort_info
->
pos
=
block_info
.
filepos
+
block_info
.
rec_len
);
block_info
.
rec_len
);
share
->
state
.
split
++
;
info
->
packed_length
=
block_info
.
rec_len
;
info
->
packed_length
=
block_info
.
rec_len
;
if
(
param
->
calc_checksum
)
if
(
param
->
calc_checksum
)
param
->
glob_crc
+=
info
->
checksum
;
param
->
glob_crc
+=
info
->
checksum
;
...
@@ -2535,6 +2537,7 @@ int sort_write_record(SORT_INFO *sort_info)
...
@@ -2535,6 +2537,7 @@ int sort_write_record(SORT_INFO *sort_info)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
sort_info
->
filepos
+=
share
->
base
.
pack_reclength
;
sort_info
->
filepos
+=
share
->
base
.
pack_reclength
;
info
->
s
->
state
.
split
++
;
/* sort_info->param->glob_crc+=mi_static_checksum(info, sort_info->record); */
/* sort_info->param->glob_crc+=mi_static_checksum(info, sort_info->record); */
break
;
break
;
case
DYNAMIC_RECORD
:
case
DYNAMIC_RECORD
:
...
@@ -2559,20 +2562,28 @@ int sort_write_record(SORT_INFO *sort_info)
...
@@ -2559,20 +2562,28 @@ int sort_write_record(SORT_INFO *sort_info)
}
}
info
->
checksum
=
mi_checksum
(
info
,
sort_info
->
record
);
info
->
checksum
=
mi_checksum
(
info
,
sort_info
->
record
);
reclength
=
_mi_rec_pack
(
info
,
from
,
sort_info
->
record
);
reclength
=
_mi_rec_pack
(
info
,
from
,
sort_info
->
record
);
/* sort_info->param->glob_crc+=info->checksum; */
block_length
=
reclength
+
3
+
test
(
reclength
>=
(
65520
-
3
));
if
(
block_length
<
share
->
base
.
min_block_length
)
block_length
=
share
->
base
.
min_block_length
;
flag
=
0
;
flag
=
0
;
info
->
update
|=
HA_STATE_WRITE_AT_END
;
/* sort_info->param->glob_crc+=info->checksum; */
block_length
=
MY_ALIGN
(
block_length
,
MI_DYN_ALIGN_SIZE
);
if
(
_mi_write_part_record
(
info
,
0L
,
block_length
,
HA_OFFSET_ERROR
,
do
&
from
,
&
reclength
,
&
flag
))
{
{
mi_check_print_error
(
param
,
"%d when writing to datafile"
,
my_errno
);
block_length
=
reclength
+
3
+
test
(
reclength
>=
(
65520
-
3
));
DBUG_RETURN
(
1
);
if
(
block_length
<
share
->
base
.
min_block_length
)
}
block_length
=
share
->
base
.
min_block_length
;
sort_info
->
filepos
+=
block_length
;
info
->
update
|=
HA_STATE_WRITE_AT_END
;
block_length
=
MY_ALIGN
(
block_length
,
MI_DYN_ALIGN_SIZE
);
if
(
block_length
>
MI_MAX_BLOCK_LENGTH
)
block_length
=
MI_MAX_BLOCK_LENGTH
;
if
(
_mi_write_part_record
(
info
,
0L
,
block_length
,
sort_info
->
filepos
+
block_length
,
&
from
,
&
reclength
,
&
flag
))
{
mi_check_print_error
(
param
,
"%d when writing to datafile"
,
my_errno
);
DBUG_RETURN
(
1
);
}
sort_info
->
filepos
+=
block_length
;
info
->
s
->
state
.
split
++
;
}
while
(
reclength
);
/* sort_info->param->glob_crc+=info->checksum; */
/* sort_info->param->glob_crc+=info->checksum; */
break
;
break
;
case
COMPRESSED_RECORD
:
case
COMPRESSED_RECORD
:
...
@@ -2588,6 +2599,7 @@ int sort_write_record(SORT_INFO *sort_info)
...
@@ -2588,6 +2599,7 @@ int sort_write_record(SORT_INFO *sort_info)
}
}
/* sort_info->param->glob_crc+=info->checksum; */
/* sort_info->param->glob_crc+=info->checksum; */
sort_info
->
filepos
+=
reclength
+
length
;
sort_info
->
filepos
+=
reclength
+
length
;
info
->
s
->
state
.
split
++
;
break
;
break
;
}
}
}
}
...
...
myisam/mi_dynrec.c
View file @
8bef3771
...
@@ -64,11 +64,13 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
...
@@ -64,11 +64,13 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
MI_DYN_DELETE_BLOCK_HEADER
+
1
;
MI_DYN_DELETE_BLOCK_HEADER
+
1
;
reclength
=
info
->
s
->
base
.
pack_reclength
+
reclength
=
info
->
s
->
base
.
pack_reclength
+
_my_calc_total_blob_length
(
info
,
record
)
+
extra
;
_my_calc_total_blob_length
(
info
,
record
)
+
extra
;
#ifdef NOT_USED
/* We now support big rows */
if
(
reclength
>
MI_DYN_MAX_ROW_LENGTH
)
if
(
reclength
>
MI_DYN_MAX_ROW_LENGTH
)
{
{
my_errno
=
HA_ERR_TO_BIG_ROW
;
my_errno
=
HA_ERR_TO_BIG_ROW
;
return
-
1
;
return
-
1
;
}
}
#endif
if
(
!
(
rec_buff
=
(
byte
*
)
my_alloca
(
reclength
)))
if
(
!
(
rec_buff
=
(
byte
*
)
my_alloca
(
reclength
)))
{
{
my_errno
=
ENOMEM
;
my_errno
=
ENOMEM
;
...
@@ -93,11 +95,13 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record)
...
@@ -93,11 +95,13 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record)
MI_DYN_DELETE_BLOCK_HEADER
;
MI_DYN_DELETE_BLOCK_HEADER
;
reclength
=
info
->
s
->
base
.
pack_reclength
+
reclength
=
info
->
s
->
base
.
pack_reclength
+
_my_calc_total_blob_length
(
info
,
record
)
+
extra
;
_my_calc_total_blob_length
(
info
,
record
)
+
extra
;
#ifdef NOT_USED
/* We now support big rows */
if
(
reclength
>
MI_DYN_MAX_ROW_LENGTH
)
if
(
reclength
>
MI_DYN_MAX_ROW_LENGTH
)
{
{
my_errno
=
HA_ERR_TO_BIG_ROW
;
my_errno
=
HA_ERR_TO_BIG_ROW
;
return
-
1
;
return
-
1
;
}
}
#endif
if
(
!
(
rec_buff
=
(
byte
*
)
my_alloca
(
reclength
)))
if
(
!
(
rec_buff
=
(
byte
*
)
my_alloca
(
reclength
)))
{
{
my_errno
=
ENOMEM
;
my_errno
=
ENOMEM
;
...
@@ -130,14 +134,14 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
...
@@ -130,14 +134,14 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
DBUG_ENTER
(
"write_dynamic_record"
);
DBUG_ENTER
(
"write_dynamic_record"
);
flag
=
0
;
flag
=
0
;
while
(
reclength
)
do
{
{
if
(
_mi_find_writepos
(
info
,
reclength
,
&
filepos
,
&
length
))
if
(
_mi_find_writepos
(
info
,
reclength
,
&
filepos
,
&
length
))
goto
err
;
goto
err
;
if
(
_mi_write_part_record
(
info
,
filepos
,
length
,
info
->
s
->
state
.
dellink
,
if
(
_mi_write_part_record
(
info
,
filepos
,
length
,
info
->
s
->
state
.
dellink
,
(
byte
**
)
&
record
,
&
reclength
,
&
flag
))
(
byte
**
)
&
record
,
&
reclength
,
&
flag
))
goto
err
;
goto
err
;
}
}
while
(
reclength
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
err:
err:
...
@@ -377,7 +381,7 @@ int _mi_write_part_record(MI_INFO *info,
...
@@ -377,7 +381,7 @@ int _mi_write_part_record(MI_INFO *info,
head_length
=
16
;
head_length
=
16
;
temp
[
0
]
=
13
;
temp
[
0
]
=
13
;
mi_int4store
(
temp
+
1
,
*
reclength
);
mi_int4store
(
temp
+
1
,
*
reclength
);
mi_int3store
(
temp
+
4
,
length
-
head_length
);
mi_int3store
(
temp
+
5
,
length
-
head_length
);
mi_sizestore
((
byte
*
)
temp
+
8
,
next_filepos
);
mi_sizestore
((
byte
*
)
temp
+
8
,
next_filepos
);
}
}
else
else
...
@@ -1441,7 +1445,7 @@ uint _mi_get_block_info(MI_BLOCK_INFO *info, File file, my_off_t filepos)
...
@@ -1441,7 +1445,7 @@ uint _mi_get_block_info(MI_BLOCK_INFO *info, File file, my_off_t filepos)
DBUG_DUMP
(
"header"
,(
byte
*
)
header
,
MI_BLOCK_INFO_HEADER_LENGTH
);
DBUG_DUMP
(
"header"
,(
byte
*
)
header
,
MI_BLOCK_INFO_HEADER_LENGTH
);
if
(
info
->
second_read
)
if
(
info
->
second_read
)
{
{
if
(
info
->
header
[
0
]
<=
6
)
if
(
info
->
header
[
0
]
<=
6
||
info
->
header
[
0
]
==
13
)
return_val
=
BLOCK_SYNC_ERROR
;
return_val
=
BLOCK_SYNC_ERROR
;
}
}
else
else
...
...
myisam/myisamdef.h
View file @
8bef3771
...
@@ -359,7 +359,7 @@ struct st_myisam_info {
...
@@ -359,7 +359,7 @@ struct st_myisam_info {
#define MI_DYN_MAX_ROW_LENGTH (MI_DYN_MAX_BLOCK_LENGTH - MI_SPLIT_LENGTH)
#define MI_DYN_MAX_ROW_LENGTH (MI_DYN_MAX_BLOCK_LENGTH - MI_SPLIT_LENGTH)
#define MI_DYN_ALIGN_SIZE 4
/* Align blocks on this */
#define MI_DYN_ALIGN_SIZE 4
/* Align blocks on this */
#define MI_MAX_DYN_HEADER_BYTE 13
/* max header byte for dynamic rows */
#define MI_MAX_DYN_HEADER_BYTE 13
/* max header byte for dynamic rows */
#define MI_MAX_BLOCK_LENGTH (((
ulong) 1 << 24)-1
)
#define MI_MAX_BLOCK_LENGTH (((
(ulong) 1 << 24)-1) & (~ (ulong) (MI_DYN_ALIGN_SIZE-1))
)
#define MEMMAP_EXTRA_MARGIN 7
/* Write this as a suffix for file */
#define MEMMAP_EXTRA_MARGIN 7
/* Write this as a suffix for file */
...
...
mysql-test/mysql-test-run.sh
View file @
8bef3771
This diff is collapsed.
Click to expand it.
mysql-test/r/query_cache.result
View file @
8bef3771
...
@@ -291,10 +291,4 @@ show status like "Qcache_queries_in_cache";
...
@@ -291,10 +291,4 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Variable_name Value
Qcache_queries_in_cache 2
Qcache_queries_in_cache 2
reset query cache;
reset query cache;
show variables like "query_cache_size";
Variable_name Value
query_cache_size 1039700
show status like "Qcache_free_memory";
Variable_name Value
Qcache_free_memory 1039700
drop table t1;
drop table t1;
mysql-test/t/group_by.test
View file @
8bef3771
...
@@ -38,7 +38,6 @@ INSERT INTO t2 VALUES (3,'name','pass','mail','Y','v','n','adr','1','1','1');
...
@@ -38,7 +38,6 @@ INSERT INTO t2 VALUES (3,'name','pass','mail','Y','v','n','adr','1','1','1');
SELECT
t2
.
userid
,
MIN
(
t1
.
score
)
FROM
t1
,
t2
WHERE
t1
.
userID
=
t2
.
userID
GROUP
BY
t2
.
userid
;
SELECT
t2
.
userid
,
MIN
(
t1
.
score
)
FROM
t1
,
t2
WHERE
t1
.
userID
=
t2
.
userID
GROUP
BY
t2
.
userid
;
SELECT
t2
.
userid
,
MIN
(
t1
.
score
)
FROM
t1
,
t2
WHERE
t1
.
userID
=
t2
.
userID
AND
t1
.
spID
=
2
GROUP
BY
t2
.
userid
;
SELECT
t2
.
userid
,
MIN
(
t1
.
score
)
FROM
t1
,
t2
WHERE
t1
.
userID
=
t2
.
userID
AND
t1
.
spID
=
2
GROUP
BY
t2
.
userid
;
SELECT
t2
.
userid
,
MIN
(
t1
.
score
+
0.0
)
FROM
t1
,
t2
WHERE
t1
.
userID
=
t2
.
userID
AND
t1
.
spID
=
2
GROUP
BY
t2
.
userid
;
SELECT
t2
.
userid
,
MIN
(
t1
.
score
+
0.0
)
FROM
t1
,
t2
WHERE
t1
.
userID
=
t2
.
userID
AND
t1
.
spID
=
2
GROUP
BY
t2
.
userid
;
drop
table
test
.
t1
,
test
.
t2
;
drop
table
test
.
t1
,
test
.
t2
;
#
#
...
@@ -220,3 +219,27 @@ select 1+1, "a",count(*) from t1 where foo in (2);
...
@@ -220,3 +219,27 @@ select 1+1, "a",count(*) from t1 where foo in (2);
insert
into
t1
values
(
1
);
insert
into
t1
values
(
1
);
select
1
+
1
,
"a"
,
count
(
*
)
from
t1
where
foo
in
(
2
);
select
1
+
1
,
"a"
,
count
(
*
)
from
t1
where
foo
in
(
2
);
drop
table
t1
;
drop
table
t1
;
#
# Test GROUP BY DESC
CREATE
TABLE
t1
(
spID
int
(
10
)
unsigned
,
userID
int
(
10
)
unsigned
,
score
smallint
(
5
)
unsigned
,
key
(
spid
),
key
(
score
)
);
INSERT
INTO
t1
VALUES
(
1
,
1
,
1
),(
2
,
2
,
2
),(
2
,
1
,
1
),(
3
,
3
,
3
),(
4
,
3
,
3
),(
5
,
3
,
3
);
explain
select
userid
,
count
(
*
)
from
t1
group
by
userid
desc
;
select
userid
,
count
(
*
)
from
t1
group
by
userid
desc
;
explain
select
spid
,
count
(
*
)
from
t1
where
spid
between
1
and
2
group
by
spid
desc
;
explain
select
spid
,
count
(
*
)
from
t1
where
spid
between
1
and
2
group
by
spid
;
select
spid
,
count
(
*
)
from
t1
where
spid
between
1
and
2
group
by
spid
;
select
spid
,
count
(
*
)
from
t1
where
spid
between
1
and
2
group
by
spid
desc
;
explain
select
sql_big_result
spid
,
sum
(
userid
)
from
t1
group
by
spid
desc
;
select
sql_big_result
spid
,
sum
(
userid
)
from
t1
group
by
spid
desc
;
explain
select
sql_big_result
score
,
count
(
*
)
from
t1
group
by
score
desc
;
select
sql_big_result
score
,
count
(
*
)
from
t1
group
by
score
desc
;
drop
table
t1
;
mysql-test/t/query_cache.test
View file @
8bef3771
...
@@ -178,6 +178,9 @@ enable_result_log;
...
@@ -178,6 +178,9 @@ enable_result_log;
show
status
like
"Qcache_hits"
;
show
status
like
"Qcache_hits"
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_queries_in_cache"
;
reset
query
cache
;
reset
query
cache
;
show
variables
like
"query_cache_size"
;
show
status
like
"Qcache_free_memory"
;
drop
table
t1
;
drop
table
t1
;
# The following tests can't be done as the values differen on 32 and 64 bit
# machines :(
#show variables like "query_cache_size";
#show status like "Qcache_free_memory";
sql/sql_cache.cc
View file @
8bef3771
...
@@ -2672,6 +2672,7 @@ uint Query_cache::filename_2_table_key (char *key, const char *path)
...
@@ -2672,6 +2672,7 @@ uint Query_cache::filename_2_table_key (char *key, const char *path)
void
Query_cache
::
wreck
(
uint
line
,
const
char
*
message
)
void
Query_cache
::
wreck
(
uint
line
,
const
char
*
message
)
{
{
THD
*
thd
=
current_thd
;
DBUG_ENTER
(
"Query_cache::wreck"
);
DBUG_ENTER
(
"Query_cache::wreck"
);
query_cache_size
=
0
;
query_cache_size
=
0
;
if
(
*
message
)
if
(
*
message
)
...
@@ -2679,7 +2680,8 @@ void Query_cache::wreck(uint line, const char *message)
...
@@ -2679,7 +2680,8 @@ void Query_cache::wreck(uint line, const char *message)
DBUG_PRINT
(
"warning"
,
(
"=================================="
));
DBUG_PRINT
(
"warning"
,
(
"=================================="
));
DBUG_PRINT
(
"warning"
,
(
"%5d QUERY CACHE WRECK => DISABLED"
,
line
));
DBUG_PRINT
(
"warning"
,
(
"%5d QUERY CACHE WRECK => DISABLED"
,
line
));
DBUG_PRINT
(
"warning"
,
(
"=================================="
));
DBUG_PRINT
(
"warning"
,
(
"=================================="
));
current_thd
->
killed
=
1
;
if
(
thd
)
thd
->
killed
=
1
;
bins_dump
();
bins_dump
();
cache_dump
();
cache_dump
();
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
...
sql/sql_select.cc
View file @
8bef3771
...
@@ -480,7 +480,9 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
...
@@ -480,7 +480,9 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
(
thd
->
select_limit
==
HA_POS_ERROR
||
(
thd
->
select_limit
==
HA_POS_ERROR
||
(
join
.
select_options
&
OPTION_FOUND_ROWS
)
||
(
join
.
select_options
&
OPTION_FOUND_ROWS
)
||
order
&&
order
&&
!
(
skip_sort_order
=
test_if_skip_sort_order
(
&
join
.
join_tab
[
join
.
const_tables
],
order
,
thd
->
select_limit
,
1
))))
!
(
skip_sort_order
=
test_if_skip_sort_order
(
&
join
.
join_tab
[
join
.
const_tables
],
order
,
thd
->
select_limit
,
1
))))
{
{
if
((
group
=
create_distinct_group
(
order
,
fields
)))
if
((
group
=
create_distinct_group
(
order
,
fields
)))
{
{
...
@@ -5272,13 +5274,6 @@ static uint find_shortest_key(TABLE *table, key_map usable_keys)
...
@@ -5272,13 +5274,6 @@ static uint find_shortest_key(TABLE *table, key_map usable_keys)
}
}
/*****************************************************************************
** If not selecting by given key, create an index how records should be read
** return: 0 ok
** -1 some fatal error
** 1 no records
*****************************************************************************/
/* Return 1 if we don't have to do file sorting */
/* Return 1 if we don't have to do file sorting */
static
bool
static
bool
...
@@ -5391,6 +5386,14 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
...
@@ -5391,6 +5386,14 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
DBUG_RETURN
(
0
);
// Can't use index.
DBUG_RETURN
(
0
);
// Can't use index.
}
}
/*****************************************************************************
If not selecting by given key, create an index how records should be read
return: 0 ok
-1 some fatal error
1 no records
*****************************************************************************/
static
int
static
int
create_sort_index
(
JOIN_TAB
*
tab
,
ORDER
*
order
,
ha_rows
select_limit
)
create_sort_index
(
JOIN_TAB
*
tab
,
ORDER
*
order
,
ha_rows
select_limit
)
{
{
...
...
sql/sql_yacc.yy
View file @
8bef3771
...
@@ -509,7 +509,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
...
@@ -509,7 +509,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
ulonglong_num
ulonglong_num
%type <item>
%type <item>
literal text_literal insert_ident
group_ident
order_ident
literal text_literal insert_ident order_ident
simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
table_wild opt_pad no_in_expr expr_expr simple_expr no_and_expr
table_wild opt_pad no_in_expr expr_expr simple_expr no_and_expr
using_list
using_list
...
@@ -1394,7 +1394,7 @@ select_lock_type:
...
@@ -1394,7 +1394,7 @@ select_lock_type:
/* empty */
/* empty */
| FOR_SYM UPDATE_SYM
| FOR_SYM UPDATE_SYM
{ Lex->lock_option= TL_WRITE; current_thd->safe_to_cache_query=0; }
{ Lex->lock_option= TL_WRITE; current_thd->safe_to_cache_query=0; }
| IN_SYM SHARE_SYM MODE_SYM
|
LOCK_SYM
IN_SYM SHARE_SYM MODE_SYM
{ Lex->lock_option= TL_READ_WITH_SHARED_LOCKS; current_thd->safe_to_cache_query=0; }
{ Lex->lock_option= TL_READ_WITH_SHARED_LOCKS; current_thd->safe_to_cache_query=0; }
select_item_list:
select_item_list:
...
@@ -2069,10 +2069,10 @@ group_clause:
...
@@ -2069,10 +2069,10 @@ group_clause:
| GROUP BY group_list
| GROUP BY group_list
group_list:
group_list:
group_list ','
group_ident
group_list ','
order_ident order_dir
{ if (add_group_to_list($3,(bool)
1
)) YYABORT; }
{ if (add_group_to_list($3,(bool)
$4
)) YYABORT; }
|
group_ident
|
order_ident order_dir
{ if (add_group_to_list($1,(bool)
1
)) YYABORT; }
{ if (add_group_to_list($1,(bool)
$2
)) YYABORT; }
/*
/*
** Order by statement in select
** Order by statement in select
...
@@ -2083,7 +2083,7 @@ opt_order_clause:
...
@@ -2083,7 +2083,7 @@ opt_order_clause:
| order_clause
| order_clause
order_clause:
order_clause:
ORDER_SYM BY
{ Select->sort_default=1; }
order_list
ORDER_SYM BY order_list
order_list:
order_list:
order_list ',' order_ident order_dir
order_list ',' order_ident order_dir
...
@@ -2093,8 +2093,8 @@ order_list:
...
@@ -2093,8 +2093,8 @@ order_list:
order_dir:
order_dir:
/* empty */ { $$ = 1; }
/* empty */ { $$ = 1; }
| ASC { $$ =
Select->sort_default=
1; }
| ASC { $$ =1; }
| DESC { $$ =
Select->sort_default=
0; }
| DESC { $$ =0; }
limit_clause:
limit_clause:
...
@@ -2813,9 +2813,6 @@ table_wild:
...
@@ -2813,9 +2813,6 @@ table_wild:
| ident '.' ident '.' '*'
| ident '.' ident '.' '*'
{ $$ = new Item_field((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS : $1.str),$3.str,"*"); }
{ $$ = new Item_field((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS : $1.str),$3.str,"*"); }
group_ident:
order_ident order_dir
order_ident:
order_ident:
expr { $$=$1; }
expr { $$=$1; }
...
...
tests/myisam-big-rows.tst
0 → 100644
View file @
8bef3771
#
# Test rows with length above > 16M
# Note that for this to work, you should start mysqld with
# -O max_allowed_packet=32M
#
drop table if exists t1;
create table t1 (a tinyint not null auto_increment, b longblob not null, primary key (a)) checksum=1;
insert into t1 (b) values(repeat(char(65),10));
insert into t1 (b) values(repeat(char(66),10));
insert into t1 (b) values(repeat(char(67),10));
update t1 set b=repeat(char(68),16777216) where a=1;
check table t1;
update t1 set b=repeat(char(69),16777000) where a=2;
update t1 set b=repeat(char(70),167) where a=3;
update t1 set b=repeat(char(71),16778000) where a=1;
update t1 set b=repeat(char(72),16778000) where a=3;
select a,length(b) from t1;
set @a=1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
update t1 set b=('A') where a=5;
delete from t1 where a=7;
set @a=@a+1;
insert into t1 (b) values (repeat(char(73+@a),16777200+@a));
update t1 set b=repeat(char(73+@a+1),17000000+@a) where a=last_insert_id();
select a,mid(b,1,5),length(b) from t1;
check table t1;
repair table t1;
check table t1;
select a from table where b<>repeat(mid(b,1,1),length(b));
delete from t1 where (a & 1);
select a from table where b<>repeat(mid(b,1,1),length(b));
check table t1;
repair table t1;
check table t1;
drop table t1;
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