Commit 4ab95562 authored by unknown's avatar unknown
Browse files

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1

into  perch.ndb.mysql.com:/home/jonas/src/mysql-4.1-push

parents 294d5a7a cc953ed3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -310,8 +310,9 @@ case $SYSTEM_TYPE in
        fi
        ;;
      *)
        if test -f "$mysql_zlib_dir/lib/libz.a" -a \ 
                -f "$mysql_zlib_dir/include/zlib.h"; then
        if test \( -f "$mysql_zlib_dir/lib/libz.a"  -o -f "$mysql_zlib_dir/lib/libz.so" -o \
                   -f "$mysql_zlib_dir/lib/libz.sl" -o -f "$mysql_zlib_dir/lib/libz.dylib" \) \
                -a -f "$mysql_zlib_dir/include/zlib.h"; then
          ZLIB_INCLUDES="-I$mysql_zlib_dir/include"
          ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz"
          MYSQL_CHECK_ZLIB_DIR
+7 −0
Original line number Diff line number Diff line
@@ -517,6 +517,13 @@ int main(int argc, char **argv)
    free_defaults(argv_to_free);
    return(1); /* purecov: deadcode */
  }

  if (mysql_query(sock, "set @@character_set_database=binary;"))
  {
    db_error(sock); /* We shall countinue here, if --force was given */
    return(1);
  }

  if (lock_tables)
    lock_table(sock, argc, argv);
  for (; *argv != NULL; argv++)
+9 −4
Original line number Diff line number Diff line
@@ -3272,19 +3272,24 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags)
        /* Read result from each column */
        for (col_idx= 0; col_idx < num_fields; col_idx++)
        {
          /* FIXME is string terminated? */
          const char *val= (const char *)bind[col_idx].buffer;
          ulonglong len= *bind[col_idx].length;
          const char *val;
          ulonglong len;
          if (col_idx < max_replace_column && replace_column[col_idx])
          {
            val= replace_column[col_idx];
            len= strlen(val);
          }
          if (*bind[col_idx].is_null)
          else if (*bind[col_idx].is_null)
          {
            val= "NULL";
            len= 4;
          }
          else
          {
            /* FIXME is string terminated? */
            val= (const char *) bind[col_idx].buffer;
            len= *bind[col_idx].length;
          }
          if (!display_result_vertically)
          {
            if (col_idx)                      /* No tab before first col */
+1 −4
Original line number Diff line number Diff line
@@ -116,15 +116,12 @@ extern "C" {
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE

/* Kernel call on NetWare that will only yield if our time slice is up */
void kYieldIfTimeSliceUp(void);

/* Some macros for portability */

#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }

/* extra protection against CPU Hogs on NetWare */
#define NETWARE_YIELD kYieldIfTimeSliceUp()
#define NETWARE_YIELD pthread_yield()
/* Screen mode for help texts */
#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A)

+39 −9
Original line number Diff line number Diff line
@@ -522,18 +522,48 @@ row_ins_cascade_calc_update_vec(
				    && ufield->new_val.len
				       < dtype_get_fixed_size(type)) {

                                        ulint cset;

				        ufield->new_val.data =
						mem_heap_alloc(heap,
						  dtype_get_fixed_size(type));
					ufield->new_val.len = 
						dtype_get_fixed_size(type);

                                        /* Handle UCS2 strings differently.
                                        As no new collations will be
                                        introduced in 4.1, we hardcode the
                                        charset-collation codes here.
                                        In 5.0, the logic is based on
                                        mbminlen. */
                                        cset = dtype_get_charset_coll(
                                          dtype_get_prtype(type));

                                        if (cset == 35/*ucs2_general_ci*/
                                            || cset == 90/*ucs2_bin*/
                                            || (cset >= 128/*ucs2_unicode_ci*/
                                          && cset <= 144
                                          /*ucs2_persian_ci*/)) {
                                          /* space=0x0020 */
                                          ulint i;
                                          for (i = 0;
                                               i < ufield->new_val.len;
                                               i += 2) {
                                            mach_write_to_2(((byte*)
                                              ufield->new_val.data)
                                              + i, 0x0020);
                                          }
                                        } else {
                                          ut_a(dtype_get_pad_char(type)
                                              != ULINT_UNDEFINED);

                                          memset(ufield->new_val.data,
					       (byte)dtype_get_pad_char(type),
					       dtype_get_fixed_size(type));
					ut_memcpy(ufield->new_val.data,
                                              (byte)dtype_get_pad_char(
                                                type),
                                              ufield->new_val.len);
                                        }

                                        memcpy(ufield->new_val.data,
                                          parent_ufield->new_val.data,
                                          parent_ufield->new_val.len);
				}
Loading