Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
65ff0fea
Commit
65ff0fea
authored
May 22, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix backslash commands broken when \connect user added.
parent
c9be1bcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
22 deletions
+18
-22
src/bin/psql/psql.c
src/bin/psql/psql.c
+16
-20
src/bin/psql/psqlHelp.h
src/bin/psql/psqlHelp.h
+2
-2
No files found.
src/bin/psql/psql.c
View file @
65ff0fea
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.6
0 1997/05/21 03:12:02
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.6
1 1997/05/22 18:55:35
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1055,19 +1055,12 @@ HandleSlashCmds(PsqlSettings * settings,
...
@@ -1055,19 +1055,12 @@ HandleSlashCmds(PsqlSettings * settings,
* assuming it's not a one-character command. If it's a one-character
* assuming it's not a one-character command. If it's a one-character
* command, this is meaningless.
* command, this is meaningless.
*/
*/
char
*
optarg3
;
/*
* Pointer inside the second <cmd> string to the argument of the slash command
* assuming it's not a one-character command. If it's a one-character
* command, this is meaningless.
*/
char
*
cmd
;
char
*
cmd
;
/*
/*
* String: value of the slash command, less the slash and with escape
* String: value of the slash command, less the slash and with escape
* sequences decoded.
* sequences decoded.
*/
*/
int
blank_loc
;
int
blank_loc
;
int
blank_loc2
;
/* Offset within <cmd> of first blank */
/* Offset within <cmd> of first blank */
cmd
=
malloc
(
strlen
(
line
));
/* unescaping better not make string grow. */
cmd
=
malloc
(
strlen
(
line
));
/* unescaping better not make string grow. */
...
@@ -1089,19 +1082,10 @@ HandleSlashCmds(PsqlSettings * settings,
...
@@ -1089,19 +1082,10 @@ HandleSlashCmds(PsqlSettings * settings,
optarg
=
NULL
;
optarg
=
NULL
;
blank_loc
=
strcspn
(
cmd
,
"
\t
"
);
blank_loc
=
strcspn
(
cmd
,
"
\t
"
);
if
(
blank_loc
==
0
)
{
if
(
blank_loc
==
0
)
optarg2
=
NULL
;
optarg2
=
NULL
;
optarg3
=
NULL
;
else
}
else
{
optarg2
=
cmd
+
blank_loc
+
strspn
(
cmd
+
blank_loc
,
"
\t
"
);
optarg2
=
cmd
+
blank_loc
+
strspn
(
cmd
+
blank_loc
,
"
\t
"
);
blank_loc2
=
strcspn
(
optarg2
,
"
\t
"
);
if
(
blank_loc2
==
0
||
*
(
optarg2
+
blank_loc2
)
==
'\0'
)
optarg3
=
NULL
;
else
{
optarg3
=
optarg2
+
blank_loc2
+
strspn
(
optarg2
+
blank_loc2
,
"
\t
"
);
*
(
optarg2
+
blank_loc2
)
=
'\0'
;
}
}
switch
(
cmd
[
0
])
{
switch
(
cmd
[
0
])
{
case
'a'
:
/* toggles to align fields on output */
case
'a'
:
/* toggles to align fields on output */
...
@@ -1124,8 +1108,20 @@ HandleSlashCmds(PsqlSettings * settings,
...
@@ -1124,8 +1108,20 @@ HandleSlashCmds(PsqlSettings * settings,
case
'c'
:{
case
'c'
:{
if
(
strncmp
(
cmd
,
"copy "
,
strlen
(
"copy "
))
==
0
)
if
(
strncmp
(
cmd
,
"copy "
,
strlen
(
"copy "
))
==
0
)
do_copy
(
optarg2
,
settings
);
do_copy
(
optarg2
,
settings
);
else
if
(
strncmp
(
cmd
,
"connect "
,
strlen
(
"connect "
))
==
0
)
else
if
(
strncmp
(
cmd
,
"connect "
,
strlen
(
"connect "
))
==
0
)
{
char
*
optarg3
;
int
blank_loc2
;
blank_loc2
=
strcspn
(
optarg2
,
"
\t
"
);
if
(
blank_loc2
==
0
||
*
(
optarg2
+
blank_loc2
)
==
'\0'
)
optarg3
=
NULL
;
else
{
optarg3
=
optarg2
+
blank_loc2
+
strspn
(
optarg2
+
blank_loc2
,
"
\t
"
);
*
(
optarg2
+
blank_loc2
)
=
'\0'
;
}
do_connect
(
optarg2
,
optarg3
,
settings
);
do_connect
(
optarg2
,
optarg3
,
settings
);
}
else
else
do_connect
(
optarg
,
optarg2
,
settings
);
do_connect
(
optarg
,
optarg2
,
settings
);
}
}
...
...
src/bin/psql/psqlHelp.h
View file @
65ff0fea
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: psqlHelp.h,v 1.1
3 1997/05/17 06:16:34 thomas
Exp $
* $Id: psqlHelp.h,v 1.1
4 1997/05/22 18:55:40 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -175,6 +175,6 @@ static struct _helpStruct QL_HELP[] = {
...
@@ -175,6 +175,6 @@ static struct _helpStruct QL_HELP[] = {
"update <class_name> set <attr1>=<expr1>,...<attrN>=<exprN> [from <from_clause>] [where <qual>];"
},
"update <class_name> set <attr1>=<expr1>,...<attrN>=<exprN> [from <from_clause>] [where <qual>];"
},
{
"vacuum"
,
{
"vacuum"
,
"vacuum the database, i.e. cleans out deleted records, updates statistics"
,
"vacuum the database, i.e. cleans out deleted records, updates statistics"
,
"vacuum [verbose] [analyze]
\n\t
or
\n
vacuum [verbose] table [analyze [(attr1, ... attrN)] ];"
},
"vacuum [verbose] [analyze]
\n\t
or
\n
vacuum [verbose]
[analyze]
table [analyze [(attr1, ... attrN)] ];"
},
{
NULL
,
NULL
,
NULL
}
/* important to keep a NULL terminator here! */
{
NULL
,
NULL
,
NULL
}
/* important to keep a NULL terminator here! */
};
};
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