Below is the list of changes that have just been committed into a local
4.1 repository of monty. When monty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2211 05/04/26 23:24:59 monty@stripped +3 -0
Cleanups during review
sql/sql_select.cc
1.397 05/04/26 23:24:47 monty@stripped +7 -5
Fixed indentation
added comment
sql/sql_insert.cc
1.159 05/04/26 23:24:46 monty@stripped +2 -2
Fix argument
mysys/default.c
1.50 05/04/26 23:24:46 monty@stripped +35 -27
Cleanup:
- Just test once for recursion level
- Don't test explicitely for \r or \n as my_isspace() already does that
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: monty
# Host: narttu.mysql.com
# Root: /home/my/mysql-4.1
--- 1.49/mysys/default.c 2005-04-14 00:39:22 +03:00
+++ 1.50/mysys/default.c 2005-04-26 23:24:46 +03:00
@@ -402,33 +402,48 @@
continue;
/* Configuration File Directives */
- if ((*ptr == '!') && (recursion_level < max_recursion_level))
+ if ((*ptr == '!'))
{
+ if (recursion_level >= max_recursion_level)
+ {
+ for (end= ptr + strlen(ptr) - 1;
+ my_isspace(&my_charset_latin1, *(end - 1));
+ end--)
+ {}
+ end[0]= 0;
+ fprintf(stderr,
+ "Warning: skipping '%s' directive as maximum include"
+ "recursion level was reached in file %s at line %d\n",
+ ptr, name, line);
+ continue;
+ }
+
/* skip over `!' and following whitespace */
for (++ptr; my_isspace(&my_charset_latin1, ptr[0]); ptr++)
{}
- if ((!strncmp(ptr, includedir_keyword, sizeof(includedir_keyword) - 1))
- && my_isspace(&my_charset_latin1, ptr[sizeof(includedir_keyword) -
1]))
+ if ((!strncmp(ptr, includedir_keyword,
+ sizeof(includedir_keyword) - 1)) &&
+ my_isspace(&my_charset_latin1, ptr[sizeof(includedir_keyword) - 1]))
{
/* skip over "includedir" and following whitespace */
for (ptr+= sizeof(includedir_keyword) - 1;
my_isspace(&my_charset_latin1, ptr[0]); ptr++)
{}
- /* trim trailing whitespace from directory name */
- end= ptr + strlen(ptr) - 1;
- /* fgets() stores the newline character in the buffer */
- if ((end[0] == '\n') || (end[0] == '\r') ||
- my_isspace(&my_charset_latin1, end[0]))
- {
- for (; my_isspace(&my_charset_latin1, *(end - 1)); end--)
- {}
- end[0]= 0;
- }
+ /*
+ trim trailing whitespace from directory name
+ The -1 below is for the newline added by fgets()
+ Note that my_isspace() is true for \r and \n
+ */
+ for (end= ptr + strlen(ptr) - 1;
+ my_isspace(&my_charset_latin1, *(end - 1));
+ end--)
+ {}
+ end[0]= 0;
/* print error msg if there is nothing after !includedir directive */
- if (end == ptr)
+ if (end <= ptr)
{
fprintf(stderr,
"error: Wrong !includedir directive in config "
@@ -468,8 +483,8 @@
my_dirend(search_dir);
}
- else if ((!strncmp(ptr, include_keyword, sizeof(include_keyword) - 1))
- && my_isspace(&my_charset_latin1, ptr[sizeof(include_keyword) -
1]))
+ else if ((!strncmp(ptr, include_keyword, sizeof(include_keyword) - 1)) &&
+ my_isspace(&my_charset_latin1, ptr[sizeof(include_keyword)-1]))
{
/* skip over `include' and following whitespace */
for (ptr+= sizeof(include_keyword) - 1;
@@ -477,12 +492,13 @@
{}
/* trim trailing whitespace from filename */
- end= ptr + strlen(ptr) - 1;
- for (; my_isspace(&my_charset_latin1, *(end - 1)) ; end--)
+ for (end= ptr + strlen(ptr) - 1;
+ my_isspace(&my_charset_latin1, *(end - 1));
+ end--)
{}
end[0]= 0;
- if (end == ptr)
+ if (end <= ptr)
{
fprintf(stderr,
"error: Wrong !include directive in config "
@@ -497,14 +513,6 @@
continue;
}
- else
- if (recursion_level >= max_recursion_level)
- {
- fprintf(stderr,
- "warning: skipping !include directive as maximum include"
- "recursion level was reached in file %s at line %d\n",
- name, line);
- }
if (*ptr == '[') /* Group name */
{
--- 1.158/sql/sql_insert.cc 2005-04-22 13:27:09 +03:00
+++ 1.159/sql/sql_insert.cc 2005-04-26 23:24:46 +03:00
@@ -72,7 +72,7 @@
{
my_printf_error(ER_WRONG_VALUE_COUNT_ON_ROW,
ER(ER_WRONG_VALUE_COUNT_ON_ROW),
- MYF(0), 1);
+ MYF(0), 1L);
return -1;
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -89,7 +89,7 @@
{
my_printf_error(ER_WRONG_VALUE_COUNT_ON_ROW,
ER(ER_WRONG_VALUE_COUNT_ON_ROW),
- MYF(0), 1);
+ MYF(0), 1L);
return -1;
}
TABLE_LIST table_list;
--- 1.396/sql/sql_select.cc 2005-04-21 01:08:15 +03:00
+++ 1.397/sql/sql_select.cc 2005-04-26 23:24:47 +03:00
@@ -2055,8 +2055,8 @@
KEY_OPTIMIZE_EXISTS) |
((old->optimize | new_fields->optimize) &
KEY_OPTIMIZE_REF_OR_NULL));
- old->null_rejecting= old->null_rejecting &&
- new_fields->null_rejecting;
+ old->null_rejecting= (old->null_rejecting &&
+ new_fields->null_rejecting);
}
}
else if (old->eq_func && new_fields->eq_func &&
@@ -2068,8 +2068,8 @@
KEY_OPTIMIZE_EXISTS) |
((old->optimize | new_fields->optimize) &
KEY_OPTIMIZE_REF_OR_NULL));
- old->null_rejecting= old->null_rejecting &&
- new_fields->null_rejecting;
+ old->null_rejecting= (old->null_rejecting &&
+ new_fields->null_rejecting);
}
else if (old->eq_func && new_fields->eq_func &&
(old->val->is_null() || new_fields->val->is_null()))
@@ -2081,7 +2081,7 @@
if (old->val->is_null())
old->val= new_fields->val;
/* The referred expression can be NULL: */
- old->null_rejecting= false;
+ old->null_rejecting= 0;
}
else
{
@@ -2242,6 +2242,8 @@
If the condition has form "tbl.keypart = othertbl.field" and
othertbl.field can be NULL, there will be no matches if othertbl.field
has NULL value.
+ We use null_rejecting in add_not_null_conds() to add
+ 'othertbl.field IS NOT NULL' to tab->select_cond.
*/
(*key_fields)->null_rejecting= (cond->functype() == Item_func::EQ_FUNC)
&&
((*value)->type() == Item::FIELD_ITEM) &&
| Thread |
|---|
| • bk commit into 4.1 tree (monty:1.2211) | monty | 26 Apr |