|
About the command "close" - How do I know which one of the bids with price higher than 2*c was submitted earlier (in order to know that bid won)?
|
First of all, every registered bid with price higher than 2C has higher priority than bids below 2C. From the other hand, there is no possibility to have more than N bids with price higher than 2C (since you should check it in "bid" command, and refuse if you already have N bids > 2C).
|
I dont understand how there can be more than one winner in an Auction?
|
If, for example, there are 5 TV sets for sale, there might be up to 5 winners. In general, as mentioned in the assignment, the maximal number of winners in an auction is the minimal quantity among its items.
|
In the command "close", "bid" and "list" should we check if the AId given is valid (if not print "Illegal auction")? (It wasn't specifically written in the instructions)
Is CurPrice should be updated when a new bid comes (with price greater than the current CurPrice) ?
|
No. Consider it as some external event (you don't have to treat it).
|
You wrote that if we reject a bid, we shoould write "illegal bid" - does it mean we should insert it into the table with value "not win"?
No. Accepting a bid doesn't necessarily ensure that it'll eventually win, and vice versa. So, if you don't accept it, you shouldn't insert it.
|
I compiled the program as it was written in the exercise but when I try to
run the program by typing "wet" I get error "no such command". What can it be?
|
You probably don't have the current directory (.) in the execution path. Try running ./wet instead of just wet.
|
So, which error messages should we print to stdout, and which to stderr?
|
All the "reguar" error messages, generated according to the logic of the program (and therefore could be interpreted as part of the output), should be printed to stdout. All the fatal errors of the system (like error executing LIBPQ functions) should be printed to stderr.
|
Can we assume that the input from the user is legal ?
|
Inside the program - yes. Of course, only concerning the number and the types of arguments. You can't assume, for example, that the customer or the auction with the specified ID exists in the DB. Also, you do have to check the parameter(s) of the program itself.
|
Can we assume that CId>0? How can we check that the parameter is integer?
|
Yes. Just check that atoi() returns positive value.
|
In the "bid" command, do we have to delete the old bid only if the new one accepted?
I can login to the SQL server directly, but when I run a C command PQconnectdb("..."), it never returns (or exits with "segmentation fault").
You must have a function named "connect" in your code, and the library for some reason uses it instead of the standard "connect". Avoid declaring in your code functions with indentical names to the standard ones (like "connect", "close", etc.) - it might cause unpredictable results!
|
What should I print in "open" command if there are no open auctions?
I think you have a mistake in the test cases.
Make sure you are running *ALL* the tests on the original DB (without any changes/updates). If you still think there is a problem, send me an e-mail.
|
When I'm running the "diff -w" command, I receive the following message for both files:
Warning: missing newline at end of file ...
|
It's OK. The automatic test will ignore it.
|
We tried to use ALIAS in UPDATE (UPDATE bid B SET...), and it reported syntax error. What is the problem?
|
Current version of PostgreSQL doesn't support this feature. Find another solution.
|
I tried to write a query using EXIST operator, and it reported syntax error. What is the problem?
|
Current version of PostgreSQL doesn't support this feature. Find another solution.
|
We tried to use "commit"/"rollback" commands, but it doesn't really work. What is the problem?
The default configuration of your session includes "auto-commit" feature, which executes "commit" automatically (implicitly) after each command. Since we didn't learn how to operate transactions, if you are not sure about a change you are going to make, you have to save somehow the state before the change, and return it after that if needed.
|
Do we have to check only the first parameter of the program, or also the rest of them?
|
You don't have to handle more than one parameter. But you do have to check that the number of parameters is not 0!
|
|