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
9d6cb54b
Commit
9d6cb54b
authored
Oct 05, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jonas/src/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1-ndb
parents
ac7771be
d60ba54d
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
102 additions
and
32 deletions
+102
-32
configure.in
configure.in
+2
-2
include/my_pthread.h
include/my_pthread.h
+0
-1
innobase/lock/lock0lock.c
innobase/lock/lock0lock.c
+9
-0
mysql-test/r/type_timestamp.result
mysql-test/r/type_timestamp.result
+17
-2
mysql-test/t/type_timestamp.test
mysql-test/t/type_timestamp.test
+13
-2
ndb/src/common/util/version.c
ndb/src/common/util/version.c
+14
-7
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+6
-3
sql/item_subselect.cc
sql/item_subselect.cc
+24
-1
sql/sql_parse.cc
sql/sql_parse.cc
+17
-14
No files found.
configure.in
View file @
9d6cb54b
...
...
@@ -15,8 +15,8 @@ SHARED_LIB_VERSION=14:0:0
# ndb version
NDB_VERSION_MAJOR
=
3
NDB_VERSION_MINOR
=
5
NDB_VERSION_BUILD
=
1
NDB_VERSION_STATUS
=
beta
NDB_VERSION_BUILD
=
2
NDB_VERSION_STATUS
=
""
# Set all version vars based on $VERSION. How do we do this more elegant ?
# Remember that regexps needs to quote [ and ] since this is run through m4
...
...
include/my_pthread.h
View file @
9d6cb54b
...
...
@@ -234,7 +234,6 @@ extern int my_sigwait(const sigset_t *set,int *sig);
#include <signal.h>
#undef sigwait
#endif
#undef _REENTRANT
/* Fix if _REENTRANT is in pthread.h */
#include <pthread.h>
#ifndef _REENTRANT
#define _REENTRANT
...
...
innobase/lock/lock0lock.c
View file @
9d6cb54b
...
...
@@ -365,6 +365,15 @@ lock_deadlock_recursive(
ulint
*
cost
);
/* in/out: number of calculation steps thus
far: if this exceeds LOCK_MAX_N_STEPS_...
we return TRUE */
/*************************************************************************
Gets the nth bit of a record lock. */
UNIV_INLINE
ibool
lock_rec_get_nth_bit
(
/*=================*/
/* out: TRUE if bit set */
lock_t
*
lock
,
/* in: record lock */
ulint
i
);
/* in: index of the bit */
#define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex)
#define lock_mutex_exit_kernel() mutex_exit(&kernel_mutex)
...
...
mysql-test/r/type_timestamp.result
View file @
9d6cb54b
...
...
@@ -369,7 +369,7 @@ create table t1 (a timestamp null, b timestamp null);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL default
CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
,
`a` timestamp NULL default
NULL
,
`b` timestamp NULL default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (NULL, NULL);
...
...
@@ -378,7 +378,22 @@ insert into t1 values ();
select * from t1;
a b
NULL NULL
2001-09-09 04:46:57 NULL
NULL NULL
drop table t1;
create table t1 (a timestamp null default current_timestamp on update current_timestamp, b timestamp null);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`b` timestamp NULL default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (NULL, NULL);
SET TIMESTAMP=1000000018;
insert into t1 values ();
select * from t1;
a b
NULL NULL
2001-09-09 04:46:58 NULL
drop table t1;
create table t1 (a timestamp null default null, b timestamp null default '2003-01-01 00:00:00');
show create table t1;
...
...
mysql-test/t/type_timestamp.test
View file @
9d6cb54b
...
...
@@ -236,9 +236,10 @@ drop table t1;
#
# Test for TIMESTAMP columns which are able to store NULLs
# (Auto-set property should work for them and NULL values
# should be OK as default values)
#
# Unlike for default TIMESTAMP fields we don't interpret first field
# in this table as TIMESTAMP with DEFAULT NOW() ON UPDATE NOW() properties.
create
table
t1
(
a
timestamp
null
,
b
timestamp
null
);
show
create
table
t1
;
insert
into
t1
values
(
NULL
,
NULL
);
...
...
@@ -247,6 +248,16 @@ insert into t1 values ();
select
*
from
t1
;
drop
table
t1
;
# But explicit auto-set properties still should be OK.
create
table
t1
(
a
timestamp
null
default
current_timestamp
on
update
current_timestamp
,
b
timestamp
null
);
show
create
table
t1
;
insert
into
t1
values
(
NULL
,
NULL
);
SET
TIMESTAMP
=
1000000018
;
insert
into
t1
values
();
select
*
from
t1
;
drop
table
t1
;
# It is also OK to specify NULL as default explicitly for such fields.
create
table
t1
(
a
timestamp
null
default
null
,
b
timestamp
null
default
'2003-01-01 00:00:00'
);
show
create
table
t1
;
insert
into
t1
values
(
NULL
,
NULL
);
...
...
ndb/src/common/util/version.c
View file @
9d6cb54b
...
...
@@ -37,13 +37,19 @@ Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) {
char
*
getVersionString
(
Uint32
version
,
char
*
status
)
{
char
buff
[
100
];
if
(
status
&&
status
[
0
]
!=
0
)
snprintf
(
buff
,
sizeof
(
buff
),
"Version %d.%d.%d (%s)"
,
getMajor
(
version
),
getMinor
(
version
),
getBuild
(
version
),
status
);
else
snprintf
(
buff
,
sizeof
(
buff
),
"Version %d.%d.%d"
,
getMajor
(
version
),
getMinor
(
version
),
getBuild
(
version
));
return
strdup
(
buff
);
}
...
...
@@ -63,6 +69,7 @@ struct NdbUpGradeCompatible {
#ifndef TEST_VERSION
struct
NdbUpGradeCompatible
ndbCompatibleTable_full
[]
=
{
{
MAKE_VERSION
(
3
,
5
,
2
),
MAKE_VERSION
(
3
,
5
,
1
),
UG_Exact
},
{
0
,
0
,
UG_Null
}
};
...
...
sql/ha_ndbcluster.cc
View file @
9d6cb54b
...
...
@@ -1203,7 +1203,8 @@ inline int ha_ndbcluster::next_result(byte *buf)
{
if
(
execute_commit
(
this
,
trans
)
!=
0
)
DBUG_RETURN
(
ndb_err
(
trans
));
DBUG_ASSERT
(
trans
->
restart
()
==
0
);
int
res
=
trans
->
restart
();
DBUG_ASSERT
(
res
==
0
);
}
ops_pending
=
0
;
}
...
...
@@ -1663,7 +1664,8 @@ int ha_ndbcluster::write_row(byte *record)
no_uncommitted_rows_execute_failure
();
DBUG_RETURN
(
ndb_err
(
trans
));
}
DBUG_ASSERT
(
trans
->
restart
()
==
0
);
int
res
=
trans
->
restart
();
DBUG_ASSERT
(
res
==
0
);
}
}
if
((
has_auto_increment
)
&&
(
skip_auto_increment
))
...
...
@@ -2294,7 +2296,8 @@ int ha_ndbcluster::rnd_init(bool scan)
{
if
(
!
scan
)
DBUG_RETURN
(
1
);
DBUG_ASSERT
(
cursor
->
restart
()
==
0
);
int
res
=
cursor
->
restart
();
DBUG_ASSERT
(
res
==
0
);
}
index_init
(
table
->
primary_key
);
DBUG_RETURN
(
0
);
...
...
sql/item_subselect.cc
View file @
9d6cb54b
...
...
@@ -638,6 +638,8 @@ String *Item_in_subselect::val_str(String *str)
}
/* Rewrite a single-column IN/ALL/ANY subselect. */
Item_subselect
::
trans_res
Item_in_subselect
::
single_value_transformer
(
JOIN
*
join
,
Comp_creator
*
func
)
...
...
@@ -656,12 +658,27 @@ Item_in_subselect::single_value_transformer(JOIN *join,
if
(
arena
->
is_stmt_prepare
())
thd
->
set_n_backup_item_arena
(
arena
,
&
backup
);
/*
Check that the right part of the subselect contains no more than one
column. E.g. in SELECT 1 IN (SELECT * ..) the right part is (SELECT * ...)
*/
if
(
select_lex
->
item_list
.
elements
>
1
)
{
my_error
(
ER_OPERAND_COLUMNS
,
MYF
(
0
),
1
);
goto
err
;
}
/*
If this is an ALL/ANY single-value subselect, try to rewrite it with
a MIN/MAX subselect. We can do that if a possible NULL result of the
subselect can be ignored.
E.g. SELECT * FROM t1 WHERE b > ANY (SELECT a FROM t2) can be rewritten
with SELECT * FROM t1 WHERE b > (SELECT MAX(a) FROM t2).
We can't check that this optimization is safe if it's not a top-level
item of the WHERE clause (e.g. because the WHERE clause can contain IS
NULL/IS NOT NULL functions). If so, we rewrite ALL/ANY with NOT EXISTS
later in this method.
*/
if
((
abort_on_null
||
(
upper_not
&&
upper_not
->
top_level
()))
&&
!
select_lex
->
master_unit
()
->
uncacheable
&&
!
func
->
eqne_op
())
{
...
...
@@ -764,7 +781,13 @@ Item_in_subselect::single_value_transformer(JOIN *join,
Item
*
item
;
item
=
(
Item
*
)
select_lex
->
item_list
.
head
();
/*
Add the left part of a subselect to a WHERE or HAVING clause of
the right part, e.g. SELECT 1 IN (SELECT a FROM t1) =>
SELECT Item_in_optimizer(1, SELECT a FROM t1 WHERE a=1)
HAVING is used only if the right part contains a SUM function, a GROUP
BY or a HAVING clause.
*/
if
(
join
->
having
||
select_lex
->
with_sum_func
||
select_lex
->
group_list
.
elements
)
{
...
...
sql/sql_parse.cc
View file @
9d6cb54b
...
...
@@ -4142,11 +4142,6 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
}
else
if
(
default_value
->
type
()
==
Item
::
NULL_ITEM
)
{
/*
TIMESTAMP type should be able to distingush non-specified default
value and default value NULL later.
*/
if
(
type
!=
FIELD_TYPE_TIMESTAMP
)
default_value
=
0
;
if
((
type_modifier
&
(
NOT_NULL_FLAG
|
AUTO_INCREMENT_FLAG
))
==
NOT_NULL_FLAG
)
...
...
@@ -4357,19 +4352,27 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
else
new_field
->
unireg_check
=
(
on_update_value
?
Field
::
TIMESTAMP_UN_FIELD
:
Field
::
NONE
);
if
(
default_value
->
type
()
==
Item
::
NULL_ITEM
)
new_field
->
def
=
0
;
}
else
{
/*
We are setting TIMESTAMP_OLD_FIELD here only temporary, we will
If we have default TIMESTAMP NOT NULL column without explicit DEFAULT
or ON UPDATE values then for the sake of compatiblity we should treat
this column as having DEFAULT NOW() ON UPDATE NOW() (when we don't
have another TIMESTAMP column with auto-set option before this one)
or DEFAULT 0 (in other cases).
So here we are setting TIMESTAMP_OLD_FIELD only temporary, and will
replace this value by TIMESTAMP_DNUN_FIELD or NONE later when
information about all TIMESTAMP fields in table will be availiable.
If we have TIMESTAMP NULL column without explicit DEFAULT value
we treat it as having DEFAULT NULL attribute.
*/
new_field
->
unireg_check
=
on_update_value
?
Field
::
TIMESTAMP_UN_FIELD
:
Field
::
TIMESTAMP_OLD_FIELD
;
new_field
->
unireg_check
=
on_update_value
?
Field
::
TIMESTAMP_UN_FIELD
:
(
new_field
->
flags
&
NOT_NULL_FLAG
?
Field
::
TIMESTAMP_OLD_FIELD
:
Field
::
NONE
);
}
break
;
case
FIELD_TYPE_DATE
:
// Old date 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