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
2c8f0828
Commit
2c8f0828
authored
Apr 05, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/jimw/my/mysql-5.0-clean
parents
c5ff7f98
de98197f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
135 additions
and
74 deletions
+135
-74
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
innobase/row/row0sel.c
innobase/row/row0sel.c
+3
-1
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+27
-18
mysql-test/r/ps.result
mysql-test/r/ps.result
+18
-0
mysql-test/r/type_bit.result
mysql-test/r/type_bit.result
+3
-0
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+18
-11
mysql-test/t/ps.test
mysql-test/t/ps.test
+21
-0
mysql-test/t/type_bit.test
mysql-test/t/type_bit.test
+8
-0
sql/sql_lex.h
sql/sql_lex.h
+3
-2
sql/sql_show.cc
sql/sql_show.cc
+31
-39
sql/unireg.cc
sql/unireg.cc
+2
-3
No files found.
BitKeeper/etc/logging_ok
View file @
2c8f0828
...
...
@@ -59,6 +59,7 @@ gerberb@ou800.zenez.com
gluh@eagle.intranet.mysql.r18.ru
gluh@gluh.(none)
gluh@gluh.mysql.r18.ru
gluh@mysql.com
gordon@zero.local.lan
greg@gcw.ath.cx
greg@mysql.com
...
...
innobase/row/row0sel.c
View file @
2c8f0828
...
...
@@ -2364,7 +2364,9 @@ row_sel_field_store_in_mysql_format(
ut_a
(
templ
->
mbmaxlen
>
templ
->
mbminlen
||
templ
->
mysql_col_len
==
len
);
ut_a
(
!
templ
->
mbmaxlen
/* The following assertion would fail for old tables
containing UTF-8 ENUM columns due to Bug #9526. */
ut_ad
(
!
templ
->
mbmaxlen
||
!
(
templ
->
mysql_col_len
%
templ
->
mbmaxlen
));
ut_a
(
len
*
templ
->
mbmaxlen
>=
templ
->
mysql_col_len
);
...
...
mysql-test/r/information_schema.result
View file @
2c8f0828
...
...
@@ -22,11 +22,11 @@ mysql
test
show databases where `database` = 't%';
Database
create database
testtets
;
create table
testtets
.t1(a int, b VARCHAR(30), KEY string_data (b));
create database
mysqltest
;
create table
mysqltest
.t1(a int, b VARCHAR(30), KEY string_data (b));
create table test.t2(a int);
create table t3(a int, KEY a_data (a));
create table
testtets
.t4(a int);
create table
mysqltest
.t4(a int);
create view v1 (c) as select table_name from information_schema.TABLES;
select * from v1;
c
...
...
@@ -62,11 +62,11 @@ time_zone_name
time_zone_transition
time_zone_transition_type
user
t1
t4
t2
t3
v1
t1
t4
select c,table_name from v1
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
...
...
@@ -80,10 +80,10 @@ time_zone_leap_second time_zone_leap_second
time_zone_name time_zone_name
time_zone_transition time_zone_transition
time_zone_transition_type time_zone_transition_type
t2 t2
t3 t3
t1 t1
t4 t4
t2 t2
t3 t3
select c, v2.table_name from v1
right join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
...
...
@@ -97,18 +97,18 @@ time_zone_leap_second time_zone_leap_second
time_zone_name time_zone_name
time_zone_transition time_zone_transition
time_zone_transition_type time_zone_transition_type
t2 t2
t3 t3
t1 t1
t4 t4
t2 t2
t3 t3
select table_name from information_schema.TABLES
where table_schema = "
testtets
" and table_name like "t%";
where table_schema = "
mysqltest
" and table_name like "t%";
table_name
t1
t4
select * from information_schema.STATISTICS where TABLE_SCHEMA = "
testtets
";
select * from information_schema.STATISTICS where TABLE_SCHEMA = "
mysqltest
";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
NULL
testtets t1 1 testtets
string_data 1 b A NULL NULL NULL YES BTREE
NULL
mysqltest t1 1 mysqltest
string_data 1 b A NULL NULL NULL YES BTREE
show keys from t3 where Key_name = "a_data";
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t3 1 a_data 1 a A NULL NULL NULL YES BTREE
...
...
@@ -133,13 +133,22 @@ c varchar(64) utf8_general_ci NO select,insert,update,references
select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL testtets t1 a 1 NULL YES int NULL NULL 11 0 NULL NULL int(11) select,insert,update,references
show columns from testtets.t1 where field like "%a%";
NULL mysqltest t1 a 1 NULL YES int NULL NULL 11 0 NULL NULL int(11) select,insert,update,references
show columns from mysqltest.t1 where field like "%a%";
Field Type Null Key Default Extra
a int(11) YES NULL
grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
select table_name, column_name, privileges from information_schema.columns
where table_schema = 'mysqltest' and table_name = 't1';
table_name column_name privileges
t1 a select
show columns from mysqltest.t1;
Field Type Null Key Default Extra
a int(11) YES NULL
b varchar(30) YES MUL NULL
drop view v1;
drop tables
testtets.t4, testtets
.t1, t2, t3;
drop database
testtets
;
drop tables
mysqltest.t4, mysqltest
.t1, t2, t3;
drop database
mysqltest
;
select * from information_schema.CHARACTER_SETS
where CHARACTER_SET_NAME like 'latin1%';
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
...
...
@@ -352,8 +361,8 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'mysqltest_1'@'localhost' NULL test t1 a REFERENCES NO
delete from mysql.user where user='mysqltest_1' or user='mysqltest_2';
delete from mysql.db where user='mysqltest_1' or user='mysqltest_2';
delete from mysql.tables_priv where user='mysqltest_1';
delete from mysql.columns_priv where user='mysqltest_1';
delete from mysql.tables_priv where user='mysqltest_1'
or user='mysqltest_2'
;
delete from mysql.columns_priv where user='mysqltest_1'
or user='mysqltest_2'
;
flush privileges;
drop table t1;
create table t1 (a int null, primary key(a));
...
...
mysql-test/r/ps.result
View file @
2c8f0828
...
...
@@ -524,3 +524,21 @@ execute stmt using @a, @b, @c;
a b c a b c
deallocate prepare stmt;
drop table t1,t2;
SET @aux= "SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS A,
INFORMATION_SCHEMA.COLUMNS B
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
AND A.TABLE_NAME = B.TABLE_NAME
AND A.COLUMN_NAME = B.COLUMN_NAME AND
A.TABLE_NAME = 'user'";
prepare my_stmt from @aux;
execute my_stmt;
COUNT(*)
37
execute my_stmt;
COUNT(*)
37
execute my_stmt;
COUNT(*)
37
deallocate prepare my_stmt;
mysql-test/r/type_bit.result
View file @
2c8f0828
...
...
@@ -377,3 +377,6 @@ hex(concat(a)) hex(concat(b))
07 0FFE
01 01FF
drop table t1;
create table t1(a int, b bit not null);
alter table t1 add primary key (a);
drop table t1;
mysql-test/t/information_schema.test
View file @
2c8f0828
...
...
@@ -17,11 +17,11 @@ show databases where `database` = 't%';
# Test for information_schema.tables &
# show tables
create
database
testtets
;
create
table
testtets
.
t1
(
a
int
,
b
VARCHAR
(
30
),
KEY
string_data
(
b
));
create
database
mysqltest
;
create
table
mysqltest
.
t1
(
a
int
,
b
VARCHAR
(
30
),
KEY
string_data
(
b
));
create
table
test
.
t2
(
a
int
);
create
table
t3
(
a
int
,
KEY
a_data
(
a
));
create
table
testtets
.
t4
(
a
int
);
create
table
mysqltest
.
t4
(
a
int
);
create
view
v1
(
c
)
as
select
table_name
from
information_schema
.
TABLES
;
select
*
from
v1
;
select
c
,
table_name
from
v1
...
...
@@ -33,9 +33,9 @@ right join information_schema.TABLES v2 on (v1.c=v2.table_name)
where
v1
.
c
like
"t%"
;
select
table_name
from
information_schema
.
TABLES
where
table_schema
=
"
testtets
"
and
table_name
like
"t%"
;
where
table_schema
=
"
mysqltest
"
and
table_name
like
"t%"
;
select
*
from
information_schema
.
STATISTICS
where
TABLE_SCHEMA
=
"
testtets
"
;
select
*
from
information_schema
.
STATISTICS
where
TABLE_SCHEMA
=
"
mysqltest
"
;
show
keys
from
t3
where
Key_name
=
"a_data"
;
show
tables
like
't%'
;
...
...
@@ -46,11 +46,19 @@ show full columns from mysql.db like "Insert%";
show
full
columns
from
v1
;
select
*
from
information_schema
.
COLUMNS
where
table_name
=
"t1"
and
column_name
=
"a"
;
show
columns
from
testtets
.
t1
where
field
like
"%a%"
;
show
columns
from
mysqltest
.
t1
where
field
like
"%a%"
;
grant
select
(
a
)
on
mysqltest
.
t1
to
mysqltest_2
@
localhost
;
connect
(
user3
,
localhost
,
mysqltest_2
,,);
connection
user3
;
select
table_name
,
column_name
,
privileges
from
information_schema
.
columns
where
table_schema
=
'mysqltest'
and
table_name
=
't1'
;
show
columns
from
mysqltest
.
t1
;
connection
default
;
drop
view
v1
;
drop
tables
testtets
.
t4
,
testtets
.
t1
,
t2
,
t3
;
drop
database
testtets
;
drop
tables
mysqltest
.
t4
,
mysqltest
.
t1
,
t2
,
t3
;
drop
database
mysqltest
;
# Test for information_schema.CHARACTER_SETS &
# SHOW CHARACTER SET
...
...
@@ -107,7 +115,6 @@ mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8);
select
count
(
*
)
from
information_schema
.
ROUTINES
;
connect
(
user1
,
localhost
,
mysqltest_1
,,);
connect
(
user3
,
localhost
,
mysqltest_2
,,);
connection
user1
;
select
ROUTINE_NAME
,
ROUTINE_DEFINITION
from
information_schema
.
ROUTINES
;
--
error
1305
...
...
@@ -166,8 +173,8 @@ select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest
select
*
from
information_schema
.
COLUMN_PRIVILEGES
where
grantee
like
'%mysqltest_1%'
;
delete
from
mysql
.
user
where
user
=
'mysqltest_1'
or
user
=
'mysqltest_2'
;
delete
from
mysql
.
db
where
user
=
'mysqltest_1'
or
user
=
'mysqltest_2'
;
delete
from
mysql
.
tables_priv
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
columns_priv
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
tables_priv
where
user
=
'mysqltest_1'
or
user
=
'mysqltest_2'
;
delete
from
mysql
.
columns_priv
where
user
=
'mysqltest_1'
or
user
=
'mysqltest_2'
;
flush
privileges
;
drop
table
t1
;
...
...
mysql-test/t/ps.test
View file @
2c8f0828
...
...
@@ -540,3 +540,24 @@ deallocate prepare stmt;
drop
table
t1
,
t2
;
#
# Bug#9383: INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement
#
eval
SET
@
aux
=
"SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS A,
INFORMATION_SCHEMA.COLUMNS B
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
AND A.TABLE_NAME = B.TABLE_NAME
AND A.COLUMN_NAME = B.COLUMN_NAME AND
A.TABLE_NAME = 'user'"
;
let
$exec_loop_count
=
3
;
eval
prepare
my_stmt
from
@
aux
;
while
(
$exec_loop_count
)
{
eval
execute
my_stmt
;
dec
$exec_loop_count
;
}
deallocate
prepare
my_stmt
;
mysql-test/t/type_bit.test
View file @
2c8f0828
...
...
@@ -112,3 +112,11 @@ insert into t1 values (7,(1<<12)-2), (0x01,0x01ff);
select
hex
(
a
),
hex
(
b
)
from
t1
;
select
hex
(
concat
(
a
)),
hex
(
concat
(
b
))
from
t1
;
drop
table
t1
;
#
# Bug #9571: problem with primary key creation
#
create
table
t1
(
a
int
,
b
bit
not
null
);
alter
table
t1
add
primary
key
(
a
);
drop
table
t1
;
sql/sql_lex.h
View file @
2c8f0828
...
...
@@ -701,8 +701,9 @@ typedef struct st_lex
TABLE_LIST
*
query_tables
;
/* global list of all tables in this query */
/*
last element next_global of previous list (used only for list building
during parsing and VIEW processing. This pointer is not valid in
mysql_execute_command
during parsing and VIEW processing. This pointer could be invalid during
processing of information schema tables(see get_schema_tables_result
function)
*/
TABLE_LIST
**
query_tables_last
;
TABLE_LIST
*
proc_table
;
/* refer to mysql.proc if it was opened by VIEW */
...
...
sql/sql_show.cc
View file @
2c8f0828
...
...
@@ -2290,8 +2290,32 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
char
tmp
[
MAX_FIELD_WIDTH
];
char
tmp1
[
MAX_FIELD_WIDTH
];
String
type
(
tmp
,
sizeof
(
tmp
),
system_charset_info
);
char
*
end
=
tmp
;
count
++
;
restore_record
(
table
,
s
->
default_values
);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint
col_access
;
check_access
(
thd
,
SELECT_ACL
|
EXTRA_ACL
,
base_name
,
&
tables
->
grant
.
privilege
,
0
,
0
);
col_access
=
get_column_grant
(
thd
,
&
tables
->
grant
,
tables
->
db
,
tables
->
table_name
,
field
->
field_name
)
&
COL_ACLS
;
if
(
lex
->
orig_sql_command
!=
SQLCOM_SHOW_FIELDS
&&
!
col_access
)
continue
;
for
(
uint
bitnr
=
0
;
col_access
;
col_access
>>=
1
,
bitnr
++
)
{
if
(
col_access
&
1
)
{
*
end
++=
','
;
end
=
strmov
(
end
,
grant_types
.
type_names
[
bitnr
]);
}
}
#else
end
=
strmov
(
end
,
""
);
#endif
table
->
field
[
17
]
->
store
(
tmp
+
1
,
end
==
tmp
?
0
:
(
uint
)
(
end
-
tmp
-
1
),
cs
);
table
->
field
[
1
]
->
store
(
base_name
,
strlen
(
base_name
),
cs
);
table
->
field
[
2
]
->
store
(
file_name
,
strlen
(
file_name
),
cs
);
table
->
field
[
3
]
->
store
(
field
->
field_name
,
strlen
(
field
->
field_name
),
...
...
@@ -2334,25 +2358,13 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
"NO"
:
"YES"
);
table
->
field
[
6
]
->
store
((
const
char
*
)
pos
,
strlen
((
const
char
*
)
pos
),
cs
);
switch
(
field
->
type
())
{
case
FIELD_TYPE_TINY_BLOB
:
case
FIELD_TYPE_MEDIUM_BLOB
:
case
FIELD_TYPE_LONG_BLOB
:
case
FIELD_TYPE_BLOB
:
case
FIELD_TYPE_VAR_STRING
:
case
FIELD_TYPE_STRING
:
if
(
field
->
has_charset
())
table
->
field
[
8
]
->
store
((
longlong
)
field
->
representation_length
()
/
field
->
charset
()
->
mbmaxlen
);
else
table
->
field
[
8
]
->
store
((
longlong
)
field
->
representation_length
());
if
(
field
->
has_charset
())
{
table
->
field
[
8
]
->
store
((
longlong
)
field
->
representation_length
()
/
field
->
charset
()
->
mbmaxlen
);
table
->
field
[
8
]
->
set_notnull
();
table
->
field
[
9
]
->
store
((
longlong
)
field
->
representation_length
());
table
->
field
[
9
]
->
set_notnull
();
break
;
default:
break
;
}
{
...
...
@@ -2410,31 +2422,12 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
(
field
->
flags
&
MULTIPLE_KEY_FLAG
)
?
"MUL"
:
""
);
table
->
field
[
15
]
->
store
((
const
char
*
)
pos
,
strlen
((
const
char
*
)
pos
),
cs
);
char
*
end
=
tmp
;
end
=
tmp
;
if
(
field
->
unireg_check
==
Field
::
NEXT_NUMBER
)
end
=
strmov
(
tmp
,
"auto_increment"
);
table
->
field
[
16
]
->
store
(
tmp
,
(
uint
)
(
end
-
tmp
),
cs
);
end
=
tmp
;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint
col_access
;
check_access
(
thd
,
SELECT_ACL
|
EXTRA_ACL
,
base_name
,
&
tables
->
grant
.
privilege
,
0
,
0
);
col_access
=
get_column_grant
(
thd
,
&
tables
->
grant
,
tables
->
db
,
tables
->
table_name
,
field
->
field_name
)
&
COL_ACLS
;
for
(
uint
bitnr
=
0
;
col_access
;
col_access
>>=
1
,
bitnr
++
)
{
if
(
col_access
&
1
)
{
*
end
++=
','
;
end
=
strmov
(
end
,
grant_types
.
type_names
[
bitnr
]);
}
}
#else
end
=
strmov
(
end
,
""
);
#endif
table
->
field
[
17
]
->
store
(
tmp
+
1
,
end
==
tmp
?
0
:
(
uint
)
(
end
-
tmp
-
1
),
cs
);
table
->
field
[
18
]
->
store
(
field
->
comment
.
str
,
field
->
comment
.
length
,
cs
);
if
(
schema_table_store_record
(
thd
,
table
))
DBUG_RETURN
(
1
);
...
...
@@ -3449,12 +3442,11 @@ bool get_schema_tables_result(JOIN *join)
TABLE_LIST
*
table_list
=
tab
->
table
->
pos_in_table_list
;
if
(
table_list
->
schema_table
&&
thd
->
fill_derived_tables
())
{
TABLE_LIST
*
save_next_global
=
table_list
->
next_global
;
TABLE_LIST
**
query_tables_last
=
lex
->
query_tables_last
;
TABLE
*
old_derived_tables
=
thd
->
derived_tables
;
MYSQL_LOCK
*
sql_lock
=
thd
->
lock
;
lex
->
sql_command
=
SQLCOM_SHOW_FIELDS
;
DBUG_ASSERT
(
!*
query_tables_last
);
if
(
&
lex
->
unit
!=
lex
->
current_select
->
master_unit
())
// is subselect
{
table_list
->
table
->
file
->
extra
(
HA_EXTRA_RESET_STATE
);
...
...
@@ -3473,8 +3465,8 @@ bool get_schema_tables_result(JOIN *join)
thd
->
lock
=
sql_lock
;
lex
->
sql_command
=
SQLCOM_SELECT
;
thd
->
derived_tables
=
old_derived_tables
;
table_list
->
next_global
=
save_next_global
;
lex
->
query_tables_last
=
query_tables_last
;
*
query_tables_last
=
0
;
}
}
thd
->
no_warnings_for_error
=
0
;
...
...
sql/unireg.cc
View file @
2c8f0828
...
...
@@ -679,15 +679,14 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type,
null_count
++
;
}
bfill
(
buff
,(
null_length
=
(
null_fields
+
7
)
/
8
),
255
);
null_pos
=
buff
;
null_pos
=
buff
+
null_count
/
8
;
List_iterator
<
create_field
>
it
(
create_fields
);
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// To find wrong default values
while
((
field
=
it
++
))
{
Field
*
regfield
=
make_field
((
char
*
)
buff
+
field
->
offset
,
field
->
length
,
field
->
flags
&
NOT_NULL_FLAG
?
0
:
null_pos
+
null_count
/
8
,
null_pos
,
null_count
&
7
,
field
->
pack_flag
,
field
->
sql_type
,
...
...
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