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
c595236c
Commit
c595236c
authored
Feb 23, 2005
by
gluh@gluh.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into gluh.mysql.r18.ru:/home/gluh/MySQL/mysql-5.0
parents
ffc92eb2
3e9bf3af
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
10 deletions
+72
-10
mysql-test/r/count_distinct2.result
mysql-test/r/count_distinct2.result
+2
-2
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+18
-2
mysql-test/r/temp_table.result
mysql-test/r/temp_table.result
+1
-1
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+10
-0
sql/sql_class.h
sql/sql_class.h
+3
-1
sql/sql_select.cc
sql/sql_select.cc
+37
-4
sql/sql_show.cc
sql/sql_show.cc
+1
-0
No files found.
mysql-test/r/count_distinct2.result
View file @
c595236c
...
...
@@ -116,7 +116,7 @@ count(distinct n)
5000
show status like 'Created_tmp_disk_tables';
Variable_name Value
Created_tmp_disk_tables
2
Created_tmp_disk_tables
1
drop table t1;
create table t1 (s text);
flush status;
...
...
@@ -125,5 +125,5 @@ count(distinct s)
5000
show status like 'Created_tmp_disk_tables';
Variable_name Value
Created_tmp_disk_tables
2
Created_tmp_disk_tables
1
drop table t1;
mysql-test/r/information_schema.result
View file @
c595236c
...
...
@@ -494,8 +494,8 @@ select TABLE_NAME,TABLE_TYPE,ENGINE
from information_schema.tables
where table_schema='information_schema' limit 2;
TABLE_NAME TABLE_TYPE ENGINE
SCHEMATA TEMPORARY M
yISAM
TABLES TEMPORARY M
yISAM
SCHEMATA TEMPORARY M
EMORY
TABLES TEMPORARY M
EMORY
show tables from information_schema like "T%";
Tables_in_information_schema (T%)
TABLES
...
...
@@ -615,3 +615,19 @@ CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
drop view a2, a1;
drop table t_crashme;
select table_schema,table_name, column_name from
information_schema.columns
where data_type = 'longtext';
table_schema table_name column_name
information_schema COLUMNS COLUMN_TYPE
information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES SQL_MODE
information_schema VIEWS VIEW_DEFINITION
select table_name, column_name, data_type from information_schema.columns
where data_type = 'datetime';
table_name column_name data_type
TABLES CREATE_TIME datetime
TABLES UPDATE_TIME datetime
TABLES CHECK_TIME datetime
ROUTINES CREATED datetime
ROUTINES LAST_ALTERED datetime
mysql-test/r/temp_table.result
View file @
c595236c
...
...
@@ -94,6 +94,6 @@ d
2002-10-24 14:50:40
show status like "created_tmp%tables";
Variable_name Value
Created_tmp_disk_tables
1
Created_tmp_disk_tables
0
Created_tmp_tables 2
drop table t1;
mysql-test/t/information_schema.test
View file @
c595236c
...
...
@@ -390,3 +390,13 @@ while ($tab_count)
--
enable_query_log
drop
view
a2
,
a1
;
drop
table
t_crashme
;
#
# Bug #7215 information_schema: columns are longtext instead of varchar
# Bug #7217 information_schema: columns are varbinary() instead of timestamp
#
select
table_schema
,
table_name
,
column_name
from
information_schema
.
columns
where
data_type
=
'longtext'
;
select
table_name
,
column_name
,
data_type
from
information_schema
.
columns
where
data_type
=
'datetime'
;
sql/sql_class.h
View file @
c595236c
...
...
@@ -1613,10 +1613,12 @@ class TMP_TABLE_PARAM :public Sql_alloc
/* If >0 convert all blob fields to varchar(convert_blob_length) */
uint
convert_blob_length
;
CHARSET_INFO
*
table_charset
;
bool
schema_table
;
TMP_TABLE_PARAM
()
:
copy_field
(
0
),
group_parts
(
0
),
group_length
(
0
),
group_null_parts
(
0
),
convert_blob_length
(
0
)
group_length
(
0
),
group_null_parts
(
0
),
convert_blob_length
(
0
),
schema_table
(
0
)
{}
~
TMP_TABLE_PARAM
()
{
...
...
sql/sql_select.cc
View file @
c595236c
...
...
@@ -7676,6 +7676,36 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
return
new_field
;
}
/*
Create field for information schema table
SYNOPSIS
create_tmp_field_for_schema()
thd Thread handler
table Temporary table
item Item to create a field for
RETURN
0 on error
new_created field
*/
Field
*
create_tmp_field_for_schema
(
THD
*
thd
,
Item
*
item
,
TABLE
*
table
)
{
if
(
item
->
field_type
()
==
MYSQL_TYPE_VARCHAR
)
{
if
(
item
->
max_length
>
MAX_FIELD_VARCHARLENGTH
/
item
->
collation
.
collation
->
mbmaxlen
)
return
new
Field_blob
(
item
->
max_length
,
item
->
maybe_null
,
item
->
name
,
table
,
item
->
collation
.
collation
);
return
new
Field_varstring
(
item
->
max_length
,
item
->
maybe_null
,
item
->
name
,
table
,
item
->
collation
.
collation
);
}
return
item
->
tmp_table_field_from_field_type
(
table
);
}
/*
Create field for temporary table
...
...
@@ -7978,10 +8008,13 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
We here distinguish between UNION and multi-table-updates by the fact
that in the later case group is set to the row pointer.
*/
Field
*
new_field
=
create_tmp_field
(
thd
,
table
,
item
,
type
,
&
copy_func
,
tmp_from_field
,
group
!=
0
,
not_all_columns
||
group
!=
0
,
param
->
convert_blob_length
);
Field
*
new_field
=
(
param
->
schema_table
)
?
create_tmp_field_for_schema
(
thd
,
item
,
table
)
:
create_tmp_field
(
thd
,
table
,
item
,
type
,
&
copy_func
,
tmp_from_field
,
group
!=
0
,
not_all_columns
||
group
!=
0
,
param
->
convert_blob_length
);
if
(
!
new_field
)
{
if
(
thd
->
is_fatal_error
)
...
...
sql/sql_show.cc
View file @
c595236c
...
...
@@ -3017,6 +3017,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
tmp_table_param
->
init
();
tmp_table_param
->
table_charset
=
cs
;
tmp_table_param
->
field_count
=
field_count
;
tmp_table_param
->
schema_table
=
1
;
SELECT_LEX
*
select_lex
=
thd
->
lex
->
current_select
;
if
(
!
(
table
=
create_tmp_table
(
thd
,
tmp_table_param
,
field_list
,
(
ORDER
*
)
0
,
0
,
0
,
...
...
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