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
58472943
Commit
58472943
authored
Mar 19, 2003
by
monty@narttu.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into narttu.mysql.fi:/my/mysql-4.0
parents
ad32b455
68ca84db
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
11 deletions
+64
-11
Docs/internals.texi
Docs/internals.texi
+11
-8
mysql-test/r/create.result
mysql-test/r/create.result
+23
-0
mysql-test/t/create.test
mysql-test/t/create.test
+17
-0
sql/handler.cc
sql/handler.cc
+8
-1
sql/sql_parse.cc
sql/sql_parse.cc
+3
-0
sql/sql_show.cc
sql/sql_show.cc
+2
-2
No files found.
Docs/internals.texi
View file @
58472943
...
@@ -2213,11 +2213,11 @@ Storage: same as TINYINT.
...
@@ -2213,11 +2213,11 @@ Storage: same as TINYINT.
@strong
{
DATE
}
@strong
{
DATE
}
@itemize @bullet
@itemize @bullet
@item
@item
Storage:
fixed-length series of binary integers, always three bytes
Storage:
3 byte integer, low byte first.
long.
Packed as: 'day + month*32 + year*16*32'
@item
@item
Example: a DATE column containing '
0001-01-01
' looks like:@*
Example: a DATE column containing '
1962-01-02
' looks like:@*
@code
{
hexadecimal 2
1 02 00
}
@code
{
hexadecimal 2
2 54 0F
}
@end itemize
@end itemize
@strong
{
DATETIME
}
@strong
{
DATETIME
}
...
@@ -2236,16 +2236,19 @@ Example: a DATETIME column for '0001-01-01 01:01:01' looks like:@*
...
@@ -2236,16 +2236,19 @@ Example: a DATETIME column for '0001-01-01 01:01:01' looks like:@*
@strong
{
TIME
}
@strong
{
TIME
}
@itemize @bullet
@itemize @bullet
@item
@item
Storage: a value offset from 8385959, always three bytes long.
Storage: 3 bytes, low byte first.
This is stored as seconds: days*24*3600+hours*3600+minutes*60+seconds
@item
@item
Example: a TIME column containing '
01:01:01'
looks like:@*
Example: a TIME column containing '
1 02:03:04' (1 day 2 hour 3 minutes and 4 seconds)
looks like:@*
@code
{
hexadecimal
75 27 00
}
@code
{
hexadecimal
58 6E 01
}
@end itemize
@end itemize
@strong
{
TIMESTAMP
}
@strong
{
TIMESTAMP
}
@itemize @bullet
@itemize @bullet
@item
@item
Storage: four bytes long (NOTE TO SELF: not figured out)
Storage: 4 bytes, low byte first.
Stored as unix @code
{
time()
}
, which is seconds since the Epoch
(00:00:00 UTC, January 1, 1970).
@item
@item
Example: a TIMESTAMP column containing '2003-01-01 01:01:01' looks like:@*
Example: a TIMESTAMP column containing '2003-01-01 01:01:01' looks like:@*
@code
{
hexadecimal 4D AE 12 23
}
@code
{
hexadecimal 4D AE 12 23
}
...
...
mysql-test/r/create.result
View file @
58472943
...
@@ -148,3 +148,26 @@ select * from t1;
...
@@ -148,3 +148,26 @@ select * from t1;
if('2002'='2002','Y','N')
if('2002'='2002','Y','N')
Y
Y
drop table if exists t1;
drop table if exists t1;
SET SESSION table_type="heap";
SELECT @@table_type;
@@table_type
HEAP
CREATE TABLE t1 (a int not null);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=HEAP
drop table t1;
SET SESSION table_type="gemini";
SELECT @@table_type;
@@table_type
GEMINI
CREATE TABLE t1 (a int not null);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=MyISAM
SET SESSION table_type=default;
drop table t1;
mysql-test/t/create.test
View file @
58472943
...
@@ -102,3 +102,20 @@ drop table t1;
...
@@ -102,3 +102,20 @@ drop table t1;
create
table
t1
select
if
(
'2002'
=
'2002'
,
'Y'
,
'N'
);
create
table
t1
select
if
(
'2002'
=
'2002'
,
'Y'
,
'N'
);
select
*
from
t1
;
select
*
from
t1
;
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
#
# Test default table type
#
SET
SESSION
table_type
=
"heap"
;
SELECT
@@
table_type
;
CREATE
TABLE
t1
(
a
int
not
null
);
show
create
table
t1
;
drop
table
t1
;
# Test what happens when using a non existing table type
SET
SESSION
table_type
=
"gemini"
;
SELECT
@@
table_type
;
CREATE
TABLE
t1
(
a
int
not
null
);
show
create
table
t1
;
SET
SESSION
table_type
=
default
;
drop
table
t1
;
sql/handler.cc
View file @
58472943
...
@@ -121,8 +121,15 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
...
@@ -121,8 +121,15 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
#endif
#endif
case
DB_TYPE_HEAP
:
case
DB_TYPE_HEAP
:
return
new
ha_heap
(
table
);
return
new
ha_heap
(
table
);
case
DB_TYPE_MYISAM
:
default:
// should never happen
default:
// should never happen
{
enum
db_type
def
=
(
enum
db_type
)
current_thd
->
variables
.
table_type
;
/* Try first with 'default table type' */
if
(
db_type
!=
def
)
return
get_new_handler
(
table
,
def
);
}
/* Fall back to MyISAM */
case
DB_TYPE_MYISAM
:
return
new
ha_myisam
(
table
);
return
new
ha_myisam
(
table
);
case
DB_TYPE_MRG_MYISAM
:
case
DB_TYPE_MRG_MYISAM
:
return
new
ha_myisammrg
(
table
);
return
new
ha_myisammrg
(
table
);
...
...
sql/sql_parse.cc
View file @
58472943
...
@@ -499,7 +499,10 @@ check_connections(THD *thd)
...
@@ -499,7 +499,10 @@ check_connections(THD *thd)
thd
->
host
=
ip_to_hostname
(
&
thd
->
remote
.
sin_addr
,
&
connect_errors
);
thd
->
host
=
ip_to_hostname
(
&
thd
->
remote
.
sin_addr
,
&
connect_errors
);
/* Cut very long hostnames to avoid possible overflows */
/* Cut very long hostnames to avoid possible overflows */
if
(
thd
->
host
)
if
(
thd
->
host
)
{
thd
->
host
[
min
(
strlen
(
thd
->
host
),
HOSTNAME_LENGTH
)]
=
0
;
thd
->
host
[
min
(
strlen
(
thd
->
host
),
HOSTNAME_LENGTH
)]
=
0
;
thd
->
host_or_ip
=
thd
->
host
;
}
if
(
connect_errors
>
max_connect_errors
)
if
(
connect_errors
>
max_connect_errors
)
return
(
ER_HOST_IS_BLOCKED
);
return
(
ER_HOST_IS_BLOCKED
);
}
}
...
...
sql/sql_show.cc
View file @
58472943
...
@@ -1064,10 +1064,10 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
...
@@ -1064,10 +1064,10 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
{
{
if
((
thd_info
->
host
=
thd
->
alloc
(
LIST_PROCESS_HOST_LEN
+
1
)))
if
((
thd_info
->
host
=
thd
->
alloc
(
LIST_PROCESS_HOST_LEN
+
1
)))
my_snprintf
((
char
*
)
thd_info
->
host
,
LIST_PROCESS_HOST_LEN
,
my_snprintf
((
char
*
)
thd_info
->
host
,
LIST_PROCESS_HOST_LEN
,
"%s:%u"
,
t
hd
->
host_or_ip
,
tmp
->
peer_port
);
"%s:%u"
,
t
mp
->
host_or_ip
,
tmp
->
peer_port
);
}
}
else
else
thd_info
->
host
=
thd
->
strdup
(
t
hd
->
host_or_ip
);
thd_info
->
host
=
thd
->
strdup
(
t
mp
->
host_or_ip
);
if
((
thd_info
->
db
=
tmp
->
db
))
// Safe test
if
((
thd_info
->
db
=
tmp
->
db
))
// Safe test
thd_info
->
db
=
thd
->
strdup
(
thd_info
->
db
);
thd_info
->
db
=
thd
->
strdup
(
thd_info
->
db
);
thd_info
->
command
=
(
int
)
tmp
->
command
;
thd_info
->
command
=
(
int
)
tmp
->
command
;
...
...
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