~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to libmysql/libmysql.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2004 MySQL AB
 
1
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
5
5
   the Free Software Foundation.
6
6
 
7
7
   There are special exceptions to the terms and conditions of the GPL as it
8
 
   is applied to this software. View the full text of the exception in file
9
 
   EXCEPTIONS-CLIENT in the directory of this software distribution.
 
8
   is applied to this software.
10
9
 
11
10
   This program is distributed in the hope that it will be useful,
12
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
14
 
16
15
   You should have received a copy of the GNU General Public License
17
16
   along with this program; if not, write to the Free Software
18
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
17
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
19
18
 
20
19
#include <my_global.h>
21
20
#include <my_sys.h>
131
130
      mysql_port = MYSQL_PORT;
132
131
#ifndef MSDOS
133
132
      {
134
 
        struct servent *serv_ptr;
135
 
        char    *env;
 
133
        char *env;
 
134
        struct servent *serv_ptr __attribute__((unused));
136
135
 
137
136
        /*
138
137
          if builder specifically requested a default port, use that
2503
2502
      set_stmt_errmsg(stmt, net);
2504
2503
    DBUG_RETURN(1);
2505
2504
  }
 
2505
  else if (mysql->status == MYSQL_STATUS_GET_RESULT)
 
2506
    stmt->mysql->status= MYSQL_STATUS_STATEMENT_GET_RESULT;
2506
2507
  DBUG_RETURN(0);
2507
2508
}
2508
2509
 
2641
2642
    set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL);
2642
2643
    return 1;
2643
2644
  }
2644
 
  if (mysql->status != MYSQL_STATUS_GET_RESULT)
 
2645
  if (mysql->status != MYSQL_STATUS_STATEMENT_GET_RESULT)
2645
2646
  {
2646
2647
    set_stmt_error(stmt, stmt->unbuffered_fetch_cancelled ?
2647
2648
                   CR_FETCH_CANCELED : CR_COMMANDS_OUT_OF_SYNC,
4421
4422
  case MYSQL_TYPE_TIME:
4422
4423
    field->max_length= 15;                    /* 19:23:48.123456 */
4423
4424
    param->skip_result= skip_result_with_length;
 
4425
    break;
4424
4426
  case MYSQL_TYPE_DATE:
4425
4427
    field->max_length= 10;                    /* 2003-11-11 */
4426
4428
    param->skip_result= skip_result_with_length;
4427
4429
    break;
4428
 
    break;
4429
4430
  case MYSQL_TYPE_DATETIME:
4430
4431
  case MYSQL_TYPE_TIMESTAMP:
4431
4432
    param->skip_result= skip_result_with_length;
4847
4848
      DBUG_RETURN(1);
4848
4849
    }
4849
4850
  }
4850
 
  else if (mysql->status != MYSQL_STATUS_GET_RESULT)
 
4851
  else if (mysql->status != MYSQL_STATUS_STATEMENT_GET_RESULT)
4851
4852
  {
4852
4853
    set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate, NULL);
4853
4854
    DBUG_RETURN(1);