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
f34a642d
Commit
f34a642d
authored
Mar 18, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
after merge fixes
parent
f9ad6504
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
289 additions
and
315 deletions
+289
-315
include/my_tree.h
include/my_tree.h
+2
-2
mysql-test/r/create.result
mysql-test/r/create.result
+3
-3
mysql-test/r/insert.result
mysql-test/r/insert.result
+205
-216
mysql-test/r/multi_update.result
mysql-test/r/multi_update.result
+4
-5
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+17
-18
mysql-test/r/rpl_error_ignored_table.result
mysql-test/r/rpl_error_ignored_table.result
+11
-11
mysql-test/r/rpl_optimize.result
mysql-test/r/rpl_optimize.result
+2
-2
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+8
-8
mysql-test/t/insert.test
mysql-test/t/insert.test
+12
-23
mysql-test/t/multi_update.test
mysql-test/t/multi_update.test
+1
-3
mysql-test/t/show_check.test
mysql-test/t/show_check.test
+2
-2
sql/field.cc
sql/field.cc
+16
-20
sql/sql_base.cc
sql/sql_base.cc
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+5
-1
No files found.
include/my_tree.h
View file @
f34a642d
...
...
@@ -22,8 +22,8 @@ extern "C" {
#include "my_base.h"
/* get 'enum ha_rkey_function' */
/* Worst case tree is half full. This gives use 2^(MAX_TREE_HIGHT/2) leafs */
#define MAX_TREE_HIGHT 64
/* Worst case tree is half full. This gives use 2^(MAX_TREE_H
E
IGHT/2) leafs */
#define MAX_TREE_H
E
IGHT 64
#define ELEMENT_KEY(tree,element)\
(tree->offset_to_key ? (void*)((byte*) element+tree->offset_to_key) :\
...
...
mysql-test/r/create.result
View file @
f34a642d
...
...
@@ -263,11 +263,11 @@ a b
3 4
drop table t1;
create table `t1 `(a int);
Incorrect table name 't1 '
ERROR 42000:
Incorrect table name 't1 '
create database `db1 `;
Incorrect database name 'db1 '
ERROR 42000:
Incorrect database name 'db1 '
create table t1(`a ` int);
Incorrect column name 'a '
ERROR 42000:
Incorrect column name 'a '
create table t1 (a int, key(a));
create table t2 (b int, foreign key(b) references t1(a), key(b));
drop table if exists t1,t2;
...
...
mysql-test/r/insert.result
View file @
f34a642d
This diff is collapsed.
Click to expand it.
mysql-test/r/multi_update.result
View file @
f34a642d
...
...
@@ -400,27 +400,26 @@ CREATE TABLE t1 ( a int );
CREATE TABLE t2 ( a int );
DELETE t1 FROM t1, t2 AS t3;
DELETE t4 FROM t1, t1 AS t4;
Not unique table/alias: 't4'
DELETE t3 FROM t1 AS t3, t1 AS t4;
Not unique table/alias: 't3'
DELETE t1 FROM t1 AS t3, t2 AS t4;
ERROR 42000: Not unique table/alias: 't1'
INSERT INTO t1 values (1),(2);
INSERT INTO t2 values (1),(2);
DELETE t1 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=1;
SELECT * from t1;
a
1
2
SELECT * from t2;
a
1
2
DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2;
SELECT * from t1;
a
2
1
SELECT * from t2;
a
1
2
DROP TABLE t1,t2;
create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) );
create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) );
...
...
mysql-test/r/query_cache.result
View file @
f34a642d
...
...
@@ -774,6 +774,23 @@ select * from t3;
delete from t4 where a=1;
flush query cache;
drop table t1,t2,t3,t4;
set query_cache_wlock_invalidate=1;
create table t1 (a int not null);
create table t2 (a int not null);
select * from t1;
a
select * from t2;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
lock table t1 write, t2 read;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
unlock table;
drop table t1,t2;
set query_cache_wlock_invalidate=default;
SET NAMES koi8r;
CREATE TABLE t1 (a char(1) character set koi8r);
INSERT INTO t1 VALUES (_koi8r''),(_koi8r'');
...
...
@@ -830,21 +847,3 @@ a
USE test;
DROP TABLE t1;
SET GLOBAL query_cache_size=0;
set query_cache_wlock_invalidate=1;
create table t1 (a int not null);
create table t2 (a int not null);
select * from t1;
a
select * from t2;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
lock table t1 write, t2 read;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
unlock table;
drop table t1,t2;
set query_cache_wlock_invalidate=default;
set GLOBAL query_cache_size=0;
mysql-test/r/rpl_error_ignored_table.result
View file @
f34a642d
...
...
@@ -9,7 +9,7 @@ insert into t1 values (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t
1
0 0 213 257 None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t
3,test.t1,test.t2
0 0 213 257 None 0 No #
show tables like 't1';
Tables_in_test (t1)
drop table t1;
...
...
@@ -26,15 +26,15 @@ select (@id := id) - id from t3;
0
kill @id;
drop table t2,t3;
Server shutdown in progress
ERROR 08S01:
Server shutdown in progress
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use `test`; create table t1 (a int primary key)
master-bin.001 149 Query 1 149 use `test`; insert into t1 values (1),(1)
master-bin.001 213 Query 1 213 use `test`; drop table t1
master-bin.001 261 Query 1 261 use `test`; create table t2 (a int primary key)
master-bin.001 331 Query 1 331 use `test`; insert into t2 values(1)
master-bin.001 390 Query 1 390 use `test`; create table t3 (id int)
master-bin.001 449 Query 1 449 use `test`; insert into t3 values(connection_id())
master-bin.001 522 Query 1 522 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
master-bin.001 613 Query 1 613 use `test`; drop table t2,t3
master-bin.00
000
1 79 Query 1 79 use `test`; create table t1 (a int primary key)
master-bin.00
000
1 149 Query 1 149 use `test`; insert into t1 values (1),(1)
master-bin.00
000
1 213 Query 1 213 use `test`; drop table t1
master-bin.00
000
1 261 Query 1 261 use `test`; create table t2 (a int primary key)
master-bin.00
000
1 331 Query 1 331 use `test`; insert into t2 values(1)
master-bin.00
000
1 390 Query 1 390 use `test`; create table t3 (id int)
master-bin.00
000
1 449 Query 1 449 use `test`; insert into t3 values(connection_id())
master-bin.00
000
1 522 Query 1 522 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
master-bin.00
000
1 613 Query 1 613 use `test`; drop table t2,t3
mysql-test/r/rpl_optimize.result
View file @
f34a642d
s
lave stop
;
s
top slave
;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
s
lave start
;
s
tart slave
;
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
INSERT INTO t1 (a) SELECT null FROM t1;
...
...
mysql-test/r/show_check.result
View file @
f34a642d
...
...
@@ -89,8 +89,8 @@ create table t1 (
test_set set( 'val1', 'val2', 'val3' ) not null default '',
name char(20) default 'O''Brien' comment 'O''Brien as default',
c int not null comment 'int column',
`c-b` int comment 'name with a
space
',
`space ` int comment 'name with a space',
`c-b` int comment 'name with a
minus
',
`space
2
` int comment 'name with a space',
) comment = 'it\'s a table' ;
show create table t1;
Table Create Table
...
...
@@ -98,8 +98,8 @@ t1 CREATE TABLE `t1` (
`test_set` set('val1','val2','val3') NOT NULL default '',
`name` char(20) default 'O''Brien' COMMENT 'O''Brien as default',
`c` int(11) NOT NULL default '0' COMMENT 'int column',
`c-b` int(11) default NULL COMMENT 'name with a
space
',
`space ` int(11) default NULL COMMENT 'name with a space'
`c-b` int(11) default NULL COMMENT 'name with a
minus
',
`space
2
` int(11) default NULL COMMENT 'name with a space'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
set sql_quote_show_create=0;
show create table t1;
...
...
@@ -108,8 +108,8 @@ t1 CREATE TABLE t1 (
test_set set('val1','val2','val3') NOT NULL default '',
name char(20) default 'O''Brien' COMMENT 'O''Brien as default',
c int(11) NOT NULL default '0' COMMENT 'int column',
`c-b` int(11) default NULL COMMENT 'name with a
space
',
`space ` int(11) default NULL COMMENT 'name with a space'
`c-b` int(11) default NULL COMMENT 'name with a
minus
',
`space
2
` int(11) default NULL COMMENT 'name with a space'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
set sql_quote_show_create=1;
show full columns from t1;
...
...
@@ -117,8 +117,8 @@ Field Type Collation Null Key Default Extra Privileges Comment
test_set set('val1','val2','val3') latin1_swedish_ci select,insert,update,references
name char(20) latin1_swedish_ci YES O'Brien select,insert,update,references O'Brien as default
c int(11) NULL 0 select,insert,update,references int column
c-b int(11) NULL YES NULL select,insert,update,references name with a
space
space int(11) NULL YES NULL select,insert,update,references name with a space
c-b int(11) NULL YES NULL select,insert,update,references name with a
minus
space
2
int(11) NULL YES NULL select,insert,update,references name with a space
drop table t1;
create table t1 (a int not null, unique aa (a));
show create table t1;
...
...
mysql-test/t/insert.test
View file @
f34a642d
...
...
@@ -93,61 +93,50 @@ drop database mysqltest;
#
use
test
;
create
table
t1
(
`number `
int
auto_increment
primary
key
,
`original_value `
varchar
(
50
),
`f_double `
double
,
`f_float `
float
,
`f_double_7_2 `
double
(
7
,
2
),
`f_float_4_3 `
float
(
4
,
3
),
`f_double_u `
double
unsigned
,
`f_float_u `
float
unsigned
,
`f_double_15_1_u `
double
(
15
,
1
)
unsigned
,
`f_float_3_1_u `
float
(
3
,
1
)
unsigned
);
create
table
t1
(
number
int
auto_increment
primary
key
,
original_value
varchar
(
50
),
f_double
double
,
f_float
float
,
f_double_7_2
double
(
7
,
2
),
f_float_4_3
float
(
4
,
3
),
f_double_u
double
unsigned
,
f_float_u
float
unsigned
,
f_double_15_1_u
double
(
15
,
1
)
unsigned
,
f_float_3_1_u
float
(
3
,
1
)
unsigned
);
set
@
value
=
"aa"
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
"1aa"
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
"aa1"
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
"1e+1111111111a"
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
"-1e+1111111111a"
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
1
e
+
1111111111
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
-
1
e
+
1111111111
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
1
e
+
111
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
-
1
e
+
111
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
1
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
set
@
value
=
-
1
;
insert
into
t1
values
(
null
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
,
@
value
);
--
query_vertical
select
*
from
t1
where
`number `
=
last_insert_id
()
--
query_vertical
select
*
from
t1
where
number
=
last_insert_id
()
drop
table
t1
;
mysql-test/t/multi_update.test
View file @
f34a642d
...
...
@@ -352,11 +352,9 @@ drop table t1,t2;
CREATE
TABLE
t1
(
a
int
);
CREATE
TABLE
t2
(
a
int
);
DELETE
t1
FROM
t1
,
t2
AS
t3
;
--
error
1066
DELETE
t4
FROM
t1
,
t1
AS
t4
;
--
error
1066
DELETE
t3
FROM
t1
AS
t3
,
t1
AS
t4
;
#
--error 1066
--
error
1066
DELETE
t1
FROM
t1
AS
t3
,
t2
AS
t4
;
INSERT
INTO
t1
values
(
1
),(
2
);
INSERT
INTO
t2
values
(
1
),(
2
);
...
...
mysql-test/t/show_check.test
View file @
f34a642d
...
...
@@ -54,8 +54,8 @@ create table t1 (
test_set
set
(
'val1'
,
'val2'
,
'val3'
)
not
null
default
''
,
name
char
(
20
)
default
'O''Brien'
comment
'O''Brien as default'
,
c
int
not
null
comment
'int column'
,
`c-b`
int
comment
'name with a
space
'
,
`space `
int
comment
'name with a space'
,
`c-b`
int
comment
'name with a
minus
'
,
`space
2
`
int
comment
'name with a space'
,
)
comment
=
'it\'s a table'
;
show
create
table
t1
;
set
sql_quote_show_create
=
0
;
...
...
sql/field.cc
View file @
f34a642d
...
...
@@ -2264,25 +2264,23 @@ void Field_longlong::sql_type(String &res) const
add_zerofill_and_unsigned
(
res
);
}
/****************************************************************************
**
single precision float
single precision float
****************************************************************************/
int
Field_float
::
store
(
const
char
*
from
,
uint
len
,
CHARSET_INFO
*
cs
)
{
int
err
;
int
err
or
;
char
*
end
;
double
nr
=
my_strntod
(
cs
,(
char
*
)
from
,
len
,
&
end
,
&
err
);
if
(
!
err
&&
(
!
current_thd
->
count_cuted_fields
||
end
-
from
==
len
))
{
return
Field_float
::
store
(
nr
);
}
else
double
nr
=
my_strntod
(
cs
,(
char
*
)
from
,
len
,
&
end
,
&
error
);
if
(
error
||
((
uint
)
(
end
-
from
)
!=
len
&&
current_thd
->
count_cuted_fields
))
{
error
=
1
;
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_TRUNCATED
);
Field_float
::
store
(
nr
);
return
1
;
}
Field_float
::
store
(
nr
);
return
error
;
}
...
...
@@ -2562,25 +2560,23 @@ void Field_float::sql_type(String &res) const
add_zerofill_and_unsigned
(
res
);
}
/****************************************************************************
**
double precision floating point numbers
double precision floating point numbers
****************************************************************************/
int
Field_double
::
store
(
const
char
*
from
,
uint
len
,
CHARSET_INFO
*
cs
)
{
int
err
;
int
err
or
;
char
*
end
;
double
nr
=
my_strntod
(
cs
,(
char
*
)
from
,
len
,
&
end
,
&
err
);
if
(
!
err
&&
(
!
current_thd
->
count_cuted_fields
||
end
-
from
==
len
))
{
return
Field_double
::
store
(
nr
);
}
else
double
nr
=
my_strntod
(
cs
,(
char
*
)
from
,
len
,
&
end
,
&
error
);
if
(
error
||
((
uint
)
(
end
-
from
)
!=
len
&&
current_thd
->
count_cuted_fields
))
{
error
=
1
;
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_TRUNCATED
);
Field_double
::
store
(
nr
);
return
1
;
}
Field_double
::
store
(
nr
);
return
error
;
}
...
...
sql/sql_base.cc
View file @
f34a642d
...
...
@@ -1427,10 +1427,10 @@ int open_tables(THD *thd, TABLE_LIST *start, uint *counter)
bool
refresh
;
int
result
=
0
;
DBUG_ENTER
(
"open_tables"
);
*
counter
=
0
;
thd
->
current_tablenr
=
0
;
restart:
*
counter
=
0
;
thd
->
proc_info
=
"Opening tables"
;
for
(
tables
=
start
;
tables
;
tables
=
tables
->
next
)
{
...
...
sql/sql_parse.cc
View file @
f34a642d
...
...
@@ -117,6 +117,7 @@ static bool end_active_trans(THD *thd)
}
#ifdef HAVE_REPLICATION
inline
bool
all_tables_not_ok
(
THD
*
thd
,
TABLE_LIST
*
tables
)
{
return
(
table_rules_on
&&
tables
&&
!
tables_ok
(
thd
,
tables
)
&&
...
...
@@ -124,6 +125,7 @@ inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables)
!
tables_ok
(
thd
,
(
TABLE_LIST
*
)
thd
->
lex
->
auxilliary_table_list
.
first
)));
}
#endif
static
HASH
hash_user_connections
;
...
...
@@ -3961,6 +3963,8 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
DBUG_VOID_RETURN
;
}
#ifdef HAVE_REPLICATION
/*
Usable by the replication SQL thread only: just parse a query to know if it
can be ignored because of replicate-*-table rules.
...
...
@@ -3985,7 +3989,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
return
error
;
}
#endif
/*****************************************************************************
** Store field definition for create
...
...
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