~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/mysqld.cc

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
526
526
#ifdef EXTRA_DEBUG
527
527
  int count=0;
528
528
#endif
529
 
  DBUG_ENTER("close_connections");
530
529
 
531
530
  /* Clear thread cache */
532
531
  kill_cached_threads++;
536
535
  (void) pthread_mutex_lock(&LOCK_manager);
537
536
  if (manager_thread_in_use)
538
537
  {
539
 
    DBUG_PRINT("quit", ("killing manager thread: 0x%lx",
540
 
                        (ulong)manager_thread));
541
538
   (void) pthread_cond_signal(&COND_manager);
542
539
  }
543
540
  (void) pthread_mutex_unlock(&LOCK_manager);
544
541
 
545
542
  /* kill connection thread */
546
 
  DBUG_PRINT("quit", ("waiting for select thread: 0x%lx",
547
 
                      (ulong) select_thread));
548
543
  (void) pthread_mutex_lock(&LOCK_thread_count);
549
544
 
550
545
  while (select_thread_in_use)
551
546
  {
552
547
    struct timespec abstime;
553
548
    int error;
554
 
    DBUG_PRINT("info",("Waiting for select thread"));
555
549
 
556
550
#ifndef DONT_USE_THR_ALARM
557
551
    if (pthread_kill(select_thread, thr_client_alarm))
575
569
 
576
570
 
577
571
  /* Abort listening to new connections */
578
 
  DBUG_PRINT("quit",("Closing sockets"));
579
572
  if (!opt_disable_networking )
580
573
  {
581
574
    if (ip_sock != INVALID_SOCKET)
599
592
  I_List_iterator<THD> it(threads);
600
593
  while ((tmp=it++))
601
594
  {
602
 
    DBUG_PRINT("quit",("Informing thread %ld that it's time to die",
603
 
                       tmp->thread_id));
604
595
    /* We skip slave threads & scheduler on this first loop through. */
605
596
    if (tmp->slave_thread)
606
597
      continue;
635
626
 
636
627
  for (;;)
637
628
  {
638
 
    DBUG_PRINT("quit",("Locking LOCK_thread_count"));
639
629
    (void) pthread_mutex_lock(&LOCK_thread_count); // For unlink from list
640
630
    if (!(tmp=threads.get()))
641
631
    {
642
 
      DBUG_PRINT("quit",("Unlocking LOCK_thread_count"));
643
632
      (void) pthread_mutex_unlock(&LOCK_thread_count);
644
633
      break;
645
634
    }
652
641
                           tmp->main_security_ctx.user : ""));
653
642
      close_connection(tmp,0,0);
654
643
    }
655
 
    DBUG_PRINT("quit",("Unlocking LOCK_thread_count"));
656
644
    (void) pthread_mutex_unlock(&LOCK_thread_count);
657
645
  }
658
646
  /* All threads has now been aborted */
659
 
  DBUG_PRINT("quit",("Waiting for threads to die (count=%u)",thread_count));
660
647
  (void) pthread_mutex_lock(&LOCK_thread_count);
661
648
  while (thread_count)
662
649
  {
663
650
    (void) pthread_cond_wait(&COND_thread_count,&LOCK_thread_count);
664
 
    DBUG_PRINT("quit",("One thread died (count=%u)",thread_count));
665
651
  }
666
652
  (void) pthread_mutex_unlock(&LOCK_thread_count);
667
653
 
668
 
  DBUG_PRINT("quit",("close_connections thread"));
669
 
  DBUG_VOID_RETURN;
 
654
  return;;
670
655
}
671
656
 
672
657
 
673
658
static void close_server_sock()
674
659
{
675
660
#ifdef HAVE_CLOSE_SERVER_SOCK
676
 
  DBUG_ENTER("close_server_sock");
677
661
  my_socket tmp_sock;
678
662
  tmp_sock=ip_sock;
679
663
  if (tmp_sock != INVALID_SOCKET)
680
664
  {
681
665
    ip_sock=INVALID_SOCKET;
682
 
    DBUG_PRINT("info",("calling shutdown on TCP/IP socket"));
683
666
    VOID(shutdown(tmp_sock, SHUT_RDWR));
684
667
  }
685
 
  DBUG_VOID_RETURN;
 
668
  return;;
686
669
#endif
687
670
}
688
671
 
689
672
 
690
673
void kill_mysql(void)
691
674
{
692
 
  DBUG_ENTER("kill_mysql");
693
675
 
694
676
#if defined(SIGNALS_DONT_BREAK_READ)
695
677
  abort_loop=1;                                 // Break connection loops
697
679
#endif
698
680
 
699
681
#if defined(HAVE_PTHREAD_KILL)
700
 
  if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL))
701
 
  {
702
 
    DBUG_PRINT("error",("Got error %d from pthread_kill",errno)); /* purecov: inspected */
703
 
  }
 
682
  pthread_kill(signal_thread, MYSQL_KILL_SIGNAL);
704
683
#elif !defined(SIGNALS_DONT_BREAK_READ)
705
684
  kill(current_pid, MYSQL_KILL_SIGNAL);
706
685
#endif
707
 
  DBUG_PRINT("quit",("After pthread_kill"));
708
686
  shutdown_in_progress=1;                       // Safety if kill didn't work
709
687
#ifdef SIGNALS_DONT_BREAK_READ
710
688
  if (!kill_in_progress)
716
694
      sql_print_error("Can't create thread to kill server");
717
695
  }
718
696
#endif
719
 
  DBUG_VOID_RETURN;
 
697
  return;;
720
698
}
721
699
 
722
700
/**
731
709
*/
732
710
 
733
711
static void *kill_server(void *sig_ptr)
734
 
#define RETURN_FROM_KILL_SERVER DBUG_RETURN(0)
 
712
#define RETURN_FROM_KILL_SERVER return(0)
735
713
{
736
 
  DBUG_ENTER("kill_server");
737
714
  int sig=(int) (long) sig_ptr;                 // This is passed a int
738
715
  // if there is a signal during the kill in progress, ignore the other
739
716
  if (kill_in_progress)                         // Safety
813
790
 
814
791
extern "C" void unireg_abort(int exit_code)
815
792
{
816
 
  DBUG_ENTER("unireg_abort");
817
793
 
818
794
  if (exit_code)
819
795
    sql_print_error("Aborting\n");
820
796
  else if (opt_help)
821
797
    usage();
822
798
  clean_up(!opt_help && (exit_code || !opt_bootstrap)); /* purecov: inspected */
823
 
  DBUG_PRINT("quit",("done with cleanup in unireg_abort"));
824
799
  mysqld_exit(exit_code);
825
800
}
826
801
 
836
811
 
837
812
void clean_up(bool print_message)
838
813
{
839
 
  DBUG_PRINT("exit",("clean_up"));
840
814
  if (cleanup_done++)
841
815
    return; /* purecov: inspected */
842
816
 
901
875
  finish_client_errs();
902
876
  my_free((uchar*) my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST),
903
877
          MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
904
 
  DBUG_PRINT("quit", ("Error messages freed"));
905
878
  /* Tell main we are ready */
906
879
  logger.cleanup_end();
907
880
  (void) pthread_mutex_lock(&LOCK_thread_count);
908
 
  DBUG_PRINT("quit", ("got thread count lock"));
909
881
  ready_to_exit=1;
910
882
  /* do the broadcast inside the lock to ensure that my_end() is not called */
911
883
  (void) pthread_cond_broadcast(&COND_thread_count);
915
887
    The following lines may never be executed as the main thread may have
916
888
    killed us
917
889
  */
918
 
  DBUG_PRINT("quit", ("done with cleanup"));
919
890
} /* clean_up */
920
891
 
921
892
 
1068
1039
static void set_user(const char *user, struct passwd *user_info_arg)
1069
1040
{
1070
1041
  /* purecov: begin tested */
1071
 
  DBUG_ASSERT(user_info_arg != 0);
 
1042
  assert(user_info_arg != 0);
1072
1043
#ifdef HAVE_INITGROUPS
1073
1044
  /*
1074
1045
    We can get a SIGSEGV when calling initgroups() on some systems when NSS
1096
1067
 
1097
1068
static void set_effective_user(struct passwd *user_info_arg)
1098
1069
{
1099
 
  DBUG_ASSERT(user_info_arg != 0);
 
1070
  assert(user_info_arg != 0);
1100
1071
  if (setregid((gid_t)-1, user_info_arg->pw_gid) == -1)
1101
1072
  {
1102
1073
    sql_perror("setregid");
1130
1101
  uint  this_wait;
1131
1102
  uint  retry;
1132
1103
  char port_buf[NI_MAXSERV];
1133
 
  DBUG_ENTER("network_init");
1134
1104
 
1135
1105
  if (thread_scheduler.init())
1136
1106
    unireg_abort(1);                    /* purecov: inspected */
1142
1112
    struct addrinfo *ai;
1143
1113
    struct addrinfo hints;
1144
1114
    int error;
1145
 
    DBUG_PRINT("general",("IP Socket is %d",mysqld_port));
1146
1115
 
1147
1116
    bzero(&hints, sizeof (hints));
1148
1117
    hints.ai_flags= AI_PASSIVE;
1153
1122
    error= getaddrinfo(my_bind_addr_str, port_buf, &hints, &ai);
1154
1123
    if (error != 0)
1155
1124
    {
1156
 
      DBUG_PRINT("error",("Got error: %d from getaddrinfo()", error));
1157
1125
      sql_perror(ER(ER_IPSOCK_ERROR));          /* purecov: tested */
1158
1126
      unireg_abort(1);                          /* purecov: tested */
1159
1127
    }
1164
1132
 
1165
1133
    if (ip_sock == INVALID_SOCKET)
1166
1134
    {
1167
 
      DBUG_PRINT("error",("Got error: %d from socket()",socket_errno));
1168
1135
      sql_perror(ER(ER_IPSOCK_ERROR));          /* purecov: tested */
1169
1136
      unireg_abort(1);                          /* purecov: tested */
1170
1137
    }
1210
1177
    freeaddrinfo(ai);
1211
1178
    if (ret < 0)
1212
1179
    {
1213
 
      DBUG_PRINT("error",("Got error: %d from bind",socket_errno));
1214
1180
      sql_perror("Can't start server: Bind on TCP/IP port");
1215
1181
      sql_print_error("Do you already have another mysqld server running on port: %d ?",mysqld_port);
1216
1182
      unireg_abort(1);
1224
1190
    }
1225
1191
  }
1226
1192
 
1227
 
  DBUG_PRINT("info",("server started"));
1228
 
  DBUG_VOID_RETURN;
 
1193
  return;;
1229
1194
}
1230
1195
 
1231
1196
/**
1241
1206
void close_connection(THD *thd, uint errcode, bool lock)
1242
1207
{
1243
1208
  st_vio *vio;
1244
 
  DBUG_ENTER("close_connection");
1245
 
  DBUG_PRINT("enter",("fd: %s  error: '%s'",
1246
 
                      thd->net.vio ? vio_description(thd->net.vio) :
1247
 
                      "(not connected)",
1248
 
                      errcode ? ER(errcode) : ""));
1249
1209
  if (lock)
1250
1210
    (void) pthread_mutex_lock(&LOCK_thread_count);
1251
1211
  thd->killed= THD::KILL_CONNECTION;
1257
1217
  }
1258
1218
  if (lock)
1259
1219
    (void) pthread_mutex_unlock(&LOCK_thread_count);
1260
 
  DBUG_VOID_RETURN;
 
1220
  return;;
1261
1221
}
1262
1222
 
1263
1223
 
1266
1226
extern "C" sig_handler end_thread_signal(int sig __attribute__((unused)))
1267
1227
{
1268
1228
  THD *thd=current_thd;
1269
 
  DBUG_ENTER("end_thread_signal");
1270
1229
  if (thd && ! thd->bootstrap)
1271
1230
  {
1272
1231
    statistic_increment(killed_threads, &LOCK_status);
1273
1232
    thread_scheduler.end_thread(thd,0);         /* purecov: inspected */
1274
1233
  }
1275
 
  DBUG_VOID_RETURN;                             /* purecov: deadcode */
 
1234
  return;;                              /* purecov: deadcode */
1276
1235
}
1277
1236
 
1278
1237
 
1289
1248
 
1290
1249
void unlink_thd(THD *thd)
1291
1250
{
1292
 
  DBUG_ENTER("unlink_thd");
1293
 
  DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd));
1294
1251
  thd->cleanup();
1295
1252
 
1296
1253
  pthread_mutex_lock(&LOCK_connection_count);
1300
1257
  (void) pthread_mutex_lock(&LOCK_thread_count);
1301
1258
  thread_count--;
1302
1259
  delete thd;
1303
 
  DBUG_VOID_RETURN;
 
1260
  return;;
1304
1261
}
1305
1262
 
1306
1263
 
1327
1284
      ! abort_loop && !kill_cached_threads)
1328
1285
  {
1329
1286
    /* Don't kill the thread, just put it in cache for reuse */
1330
 
    DBUG_PRINT("info", ("Adding thread to cache"));
1331
1287
    cached_thread_count++;
1332
1288
    while (!abort_loop && ! wake_thread && ! kill_cached_threads)
1333
1289
      (void) pthread_cond_wait(&COND_thread_cache, &LOCK_thread_count);
1377
1333
 
1378
1334
bool one_thread_per_connection_end(THD *thd, bool put_in_cache)
1379
1335
{
1380
 
  DBUG_ENTER("one_thread_per_connection_end");
1381
1336
  unlink_thd(thd);
1382
1337
  if (put_in_cache)
1383
1338
    put_in_cache= cache_thread();
1384
1339
  pthread_mutex_unlock(&LOCK_thread_count);
1385
1340
  if (put_in_cache)
1386
 
    DBUG_RETURN(0);                             // Thread is reused
 
1341
    return(0);                             // Thread is reused
1387
1342
 
1388
1343
  /* It's safe to broadcast outside a lock (COND... is not deleted here) */
1389
 
  DBUG_PRINT("signal", ("Broadcasting COND_thread_count"));
1390
1344
  my_thread_end();
1391
1345
  (void) pthread_cond_broadcast(&COND_thread_count);
1392
1346
 
1393
1347
  pthread_exit(0);
1394
 
  DBUG_RETURN(0);                               // Impossible
 
1348
  return(0);                               // Impossible
1395
1349
}
1396
1350
 
1397
1351
 
1419
1373
extern "C" sig_handler abort_thread(int sig __attribute__((unused)))
1420
1374
{
1421
1375
  THD *thd=current_thd;
1422
 
  DBUG_ENTER("abort_thread");
1423
1376
  if (thd)
1424
1377
    thd->killed= THD::KILL_CONNECTION;
1425
 
  DBUG_VOID_RETURN;
 
1378
  return;;
1426
1379
}
1427
1380
#endif
1428
1381
 
1582
1535
{
1583
1536
  sigset_t set;
1584
1537
  struct sigaction sa;
1585
 
  DBUG_ENTER("init_signals");
1586
1538
 
1587
1539
  my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
1588
1540
 
1645
1597
    sigaddset(&set,SIGINT);
1646
1598
  sigprocmask(SIG_SETMASK,&set,NULL);
1647
1599
  pthread_sigmask(SIG_SETMASK,&set,NULL);
1648
 
  DBUG_VOID_RETURN;
 
1600
  return;;
1649
1601
}
1650
1602
 
1651
1603
 
1653
1605
{
1654
1606
  int error;
1655
1607
  pthread_attr_t thr_attr;
1656
 
  DBUG_ENTER("start_signal_handler");
1657
1608
 
1658
1609
  (void) pthread_attr_init(&thr_attr);
1659
1610
  pthread_attr_setscope(&thr_attr, PTHREAD_SCOPE_SYSTEM);
1686
1637
  pthread_mutex_unlock(&LOCK_thread_count);
1687
1638
 
1688
1639
  (void) pthread_attr_destroy(&thr_attr);
1689
 
  DBUG_VOID_RETURN;
 
1640
  return;;
1690
1641
}
1691
1642
 
1692
1643
 
1697
1648
  sigset_t set;
1698
1649
  int sig;
1699
1650
  my_thread_init();                             // Init new thread
1700
 
  DBUG_ENTER("signal_hand");
1701
1651
  signal_thread_in_use= 1;
1702
1652
 
1703
1653
  /*
1759
1709
      while ((error=my_sigwait(&set,&sig)) == EINTR) ;
1760
1710
    if (cleanup_done)
1761
1711
    {
1762
 
      DBUG_PRINT("quit",("signal_handler: calling my_thread_end()"));
1763
1712
      my_thread_end();
1764
1713
      signal_thread_in_use= 0;
1765
1714
      pthread_exit(0);                          // Safety
1774
1723
      /* switch to the old log message processing */
1775
1724
      logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_FILE:LOG_NONE,
1776
1725
                          opt_log ? LOG_FILE:LOG_NONE);
1777
 
      DBUG_PRINT("info",("Got signal: %d  abort_loop: %d",sig,abort_loop));
1778
1726
      if (!abort_loop)
1779
1727
      {
1780
1728
        abort_loop=1;                           // mark abort for threads
1852
1800
void my_message_sql(uint error, const char *str, myf MyFlags)
1853
1801
{
1854
1802
  THD *thd;
1855
 
  DBUG_ENTER("my_message_sql");
1856
 
  DBUG_PRINT("error", ("error: %u  message: '%s'", error, str));
1857
1803
  /*
1858
1804
    Put here following assertion when situation with EE_* error codes
1859
1805
    will be fixed
1860
 
    DBUG_ASSERT(error != 0);
1861
1806
  */
1862
1807
  if ((thd= current_thd))
1863
1808
  {
1879
1824
    */
1880
1825
    if (thd->handle_error(error, str,
1881
1826
                          MYSQL_ERROR::WARN_LEVEL_ERROR))
1882
 
      DBUG_VOID_RETURN;
 
1827
      return;;
1883
1828
 
1884
1829
    thd->is_slave_error=  1; // needed to catch query errors during replication
1885
1830
 
1888
1833
      (not query command (COM_QUERY))
1889
1834
    */
1890
1835
    if (thd->lex->current_select &&
1891
 
        thd->lex->current_select->no_error && !thd->is_fatal_error)
 
1836
        thd->lex->current_select->no_error && !thd->is_fatal_error)
1892
1837
    {
1893
 
      DBUG_PRINT("error",
1894
 
                 ("Error converted to warning: current_select: no_error %d  "
1895
 
                  "fatal_error: %d",
1896
 
                  (thd->lex->current_select ?
1897
 
                   thd->lex->current_select->no_error : 0),
1898
 
                  (int) thd->is_fatal_error));
 
1838
      /* DBUG_WAS_HERE */
1899
1839
    }
1900
1840
    else
1901
1841
    {
1922
1862
  }
1923
1863
  if (!thd || MyFlags & ME_NOREFRESH)
1924
1864
    sql_print_error("%s: %s",my_progname,str); /* purecov: inspected */
1925
 
  DBUG_VOID_RETURN;
 
1865
  return;;
1926
1866
}
1927
1867
 
1928
1868
 
2158
2098
  get_options(&defaults_argc, defaults_argv);
2159
2099
  set_server_version();
2160
2100
 
2161
 
  DBUG_PRINT("info",("%s  Ver %s for %s on %s\n",my_progname,
2162
 
                     server_version, SYSTEM_TYPE,MACHINE_TYPE));
2163
2101
 
2164
2102
  /* connections and databases needs lots of files */
2165
2103
  {
2200
2138
        table_cache_size= (ulong) min(max((files-10-max_connections)/2,
2201
2139
                                          TABLE_OPEN_CACHE_MIN),
2202
2140
                                      table_cache_size);
2203
 
        DBUG_PRINT("warning",
2204
 
                   ("Changed limits: max_open_files: %u  max_connections: %ld  table_cache: %ld",
2205
 
                    files, max_connections, table_cache_size));
2206
2141
        if (global_system_variables.log_warnings)
2207
2142
          sql_print_warning("Changed limits: max_open_files: %u  max_connections: %ld  table_cache: %ld",
2208
2143
                        files, max_connections, table_cache_size);
2337
2272
    insensitive names.  If this is not done the users MyISAM tables will
2338
2273
    get corrupted if accesses with names of different case.
2339
2274
  */
2340
 
  DBUG_PRINT("info", ("lower_case_table_names: %d", lower_case_table_names));
2341
2275
  lower_case_file_system= test_if_case_insensitive(mysql_real_data_home);
2342
2276
  if (!lower_case_table_names && lower_case_file_system == 1)
2343
2277
  {
2439
2373
 
2440
2374
static int init_server_components()
2441
2375
{
2442
 
  DBUG_ENTER("init_server_components");
2443
2376
  /*
2444
2377
    We need to call each of these following functions to ensure that
2445
2378
    all things are initialized so that unireg_abort() doesn't fail
2498
2431
      global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
2499
2432
    else
2500
2433
    { 
2501
 
      DBUG_ASSERT(global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC);
2502
 
  }
 
2434
      assert(global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC);
 
2435
    }
2503
2436
 
2504
2437
  /* Check that we have not let the format to unspecified at this point */
2505
 
  DBUG_ASSERT((uint)global_system_variables.binlog_format <=
 
2438
  assert((uint)global_system_variables.binlog_format <=
2506
2439
              array_elements(binlog_format_names)-1);
2507
2440
 
2508
2441
  if (opt_log_slave_updates && replicate_same_server_id)
2556
2489
 
2557
2490
  /* Allow storage engine to give real error messages */
2558
2491
  if (ha_init_errors())
2559
 
    DBUG_RETURN(1);
 
2492
    return(1);
2560
2493
 
2561
2494
  if (plugin_init(&defaults_argc, defaults_argv,
2562
2495
                  (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
2639
2572
                        default_storage_engine_str);
2640
2573
        unireg_abort(1);
2641
2574
      }
2642
 
      DBUG_ASSERT(global_system_variables.table_plugin);
 
2575
      assert(global_system_variables.table_plugin);
2643
2576
    }
2644
2577
    else
2645
2578
    {
2704
2637
    locked_in_memory=0;
2705
2638
 
2706
2639
  init_update_queries();
2707
 
  DBUG_RETURN(0);
 
2640
  return(0);
2708
2641
}
2709
2642
 
2710
2643
 
2866
2799
 
2867
2800
  /* (void) pthread_attr_destroy(&connection_attrib); */
2868
2801
  
2869
 
  DBUG_PRINT("quit",("Exiting main thread"));
2870
2802
 
2871
2803
#ifdef EXTRA_DEBUG2
2872
2804
  sql_print_error("Before Lock_thread_count");
2873
2805
#endif
2874
2806
  (void) pthread_mutex_lock(&LOCK_thread_count);
2875
 
  DBUG_PRINT("quit", ("Got thread_count mutex"));
2876
2807
  select_thread_in_use=0;                       // For close_connections
2877
2808
  (void) pthread_mutex_unlock(&LOCK_thread_count);
2878
2809
  (void) pthread_cond_broadcast(&COND_thread_count);
2906
2837
 
2907
2838
static void create_new_thread(THD *thd)
2908
2839
{
2909
 
  DBUG_ENTER("create_new_thread");
2910
2840
 
2911
2841
  /*
2912
2842
    Don't allow too many connections. We roughly check here that we allow
2919
2849
  {
2920
2850
    pthread_mutex_unlock(&LOCK_connection_count);
2921
2851
 
2922
 
    DBUG_PRINT("error",("Too many connections"));
2923
2852
    close_connection(thd, ER_CON_COUNT_ERROR, 1);
2924
2853
    delete thd;
2925
 
    DBUG_VOID_RETURN;
 
2854
    return;;
2926
2855
  }
2927
2856
 
2928
2857
  ++connection_count;
2947
2876
 
2948
2877
  thread_scheduler.add_connection(thd);
2949
2878
 
2950
 
  DBUG_VOID_RETURN;
 
2879
  return;;
2951
2880
}
2952
2881
 
2953
2882
 
2986
2915
    FD_SET(ip_sock,&clientFDs);
2987
2916
    ip_flags = fcntl(ip_sock, F_GETFL, 0);
2988
2917
  }
2989
 
  DBUG_PRINT("general",("Waiting for connections."));
2990
2918
  MAYBE_BROKEN_SYSCALL;
2991
2919
  while (!abort_loop)
2992
2920
  {
5171
5099
  const char *end,*i,*j;
5172
5100
  const char **array, *pos;
5173
5101
  ulong found,found_int,bit;
5174
 
  DBUG_ENTER("find_bit_type");
5175
 
  DBUG_PRINT("enter",("x: '%s'",x));
5176
5102
 
5177
5103
  found=0;
5178
5104
  found_end= 0;
5210
5136
skip: ;
5211
5137
    }
5212
5138
    if (found_count != 1)
5213
 
      DBUG_RETURN(~(ulong) 0);                          // No unique value
 
5139
      return(~(ulong) 0);                               // No unique value
5214
5140
    found|=found_int;
5215
5141
    pos=end+1;
5216
5142
  }
5217
5143
 
5218
 
  DBUG_PRINT("exit",("bit-field: %ld",(ulong) found));
5219
 
  DBUG_RETURN(found);
 
5144
  return(found);
5220
5145
} /* find_bit_type */
5221
5146
 
5222
5147
 
5239
5164
  File file;
5240
5165
  char buff[FN_REFLEN], buff2[FN_REFLEN];
5241
5166
  struct stat stat_info;
5242
 
  DBUG_ENTER("test_if_case_insensitive");
5243
5167
 
5244
5168
  fn_format(buff, glob_hostname, dir_name, ".lower-test",
5245
5169
            MY_UNPACK_FILENAME | MY_REPLACE_EXT | MY_REPLACE_DIR);
5249
5173
  if ((file= my_create(buff, 0666, O_RDWR, MYF(0))) < 0)
5250
5174
  {
5251
5175
    sql_print_warning("Can't create test file %s", buff);
5252
 
    DBUG_RETURN(-1);
 
5176
    return(-1);
5253
5177
  }
5254
5178
  my_close(file, MYF(0));
5255
5179
  if (!stat(buff2, &stat_info))
5256
5180
    result= 1;                                  // Can access file
5257
5181
  (void) my_delete(buff, MYF(MY_WME));
5258
 
  DBUG_PRINT("exit", ("result: %d", result));
5259
 
  DBUG_RETURN(result);
 
5182
  return(result);
5260
5183
}
5261
5184
 
5262
5185