Open mschatten opened 5 years ago
Javljam se za rješavanje ovog problema.
\q - Disconnect from the server and quit akdb client.
\? - List all commands supported in akdb.
_\d
_create index
_update
_grant
1) \q - Ispravno radi :heavy_check_mark:
2) \? - Ispravno radi :heavy_check_mark:
3) _\d AttributeError: Table_details_command instance has no attribute 'execute'
\d jakov
Number of attributes: -2
Number of records: -2
4) _\p
OK
dok server ispisuje poruku Table jakov does not exist!
da prethodno kreirana tablica ne postoji.''' For some reason, AK_table_exists won't work, it always just exits here, so it's commented out. '''
5) _\t
akdb>create table jakov(name varchar(30))
Table created
akdb>\t jakov?
Table does not exist.
6) _create index
For some reason, AK_table_exists won't work, it always just exits here, so it's commented out.
2) Not working
- typeError: in method 'AK_create_Index', argument 2 of type 'AK_list*'
7) create user \<username> with password \<password> - Ne radi :x:
akdb>create user myuser with password jakov
Wrong command.
# User insert does not work. Password needs to be inserted in hash format.
8) _create trigger
For some reason, AK_table_exists won't work, it always just exits here, so it's commented out.
2) Not working
- TypeError: in method 'AK_trigger_add, argument 3 of type 'AK_list*'
9) _create sequence
needed revision in sequence.c in function AK_sequence_add which receives only int values but posible is also bigint which is default for undefined values
2) isinstance needs revision for swig
3) Needs more revision for swig after buffer overflow is handled
10) _create table akdb>create table tablica(redak varchar(30))
Table created
akdb>\t tablica?
Table does not exist.
For some reason, AK_table_exists won't work, it always just exits here, so it's commented out.
2) Create table in table.c currently takes only name and type of attributes.
Parsing works for other attribute properties as well, so it should be added here when possible.
11) _create view akdb>create view comedies as select * from films where kind = 'comedy'
Wrong command.
_create function create function add(integer, integer) returns integer as 'select $1 + $2;' language sql returns null on null input
Wrong command.
12) _alter index create index idx_name on jakov(name)
Wrong command.
alter index idx_name rename to idx_test
Wrong command.
13) _alter table
14) _alter sequence
15) _alter view
16) _select
ALERT
translate expression from infix to postfix
add rest of akdb types to 'get_attr_type()' such as TYPE_ATTRIBS, TYPE_OPERAND, TYPE_OPERATOR, etc.
fix 'selection_test()' -> 'AK_selection' --> it selects all (*) data instead of taking 'selected attributes' in account
similar problems also found with WHERE clause
Justin Case check select tokenizer/executor logic
Warning: contains HC-ed data for testing purpose
17) _update
ALERT
reimplementation of 'AK_update[_row] for simplicity !?
'AK_update_row' returns valid answer (True/EXIT_SUCCESS) although change isn't visible
-> possible problems with update tokenizer/executor logic or AK_update_row implementation
18) _insert into akdb>create table jakov2(ime varchar(30))
Table created
akdb>insert into jakov2 values ('mojeime')
Wrong command.
akdb>insert into jakov2(ime) values ('mojeime')
Wrong command.
19) _grant
akdb>create table novcic(boja varchar(30))
Table created
akdb>grant insert on novcic to public
GRANT -1
2) Server:
2019-04-17 00:08:18,065 - INFO - create table novcic(boja varchar(30))
. . .
2019-04-17 00:08:31,654 - INFO - grant insert on novcic to public
. . .
Printing out :
`
Invalid table name or username!
ERROR: User or table does not exsist: publicnovcic`
20) _drop
akdb>create table jakov22(redak varchar(20))
Table created
akdb>drop table jakov22
`
akdb>`
2) Server
*crashes*21) _begin
22) history - Ispravno radi :heavy_check_mark:
akdb>\?
Commands: . . .
akdb>\t jakov?
Table does not exist.
akdb>create table pogledajmeuhistoryu(hehe varchar(69))
Table created
akdb>history
['\\?', '\\t jakov?', 'create table pogledajmeuhistoryu(hehe varchar(69))', 'history']
'akdb>'
*Poseban slučaj* create group command ima svoju implementaciju na strani _sqlexecutor.py koda ali je cijela zakomentirana
1) #### Popis naredbi koje pišu da su implementirane u Python katalogu ali zapravno im nedostaje implementacija: ####
_create view
2) #### Popis naredbi / fukcionalnosti koje su implementirane na strani C koda a nisu u Pythonu: ####
1) _int Ak_deleterow()
2) _int AK_function_change_returntype() , _int AK_funtionrename() , ...
3) _int AK_userrename() , _int AK_revoke_priviledgeuser()
4) _int AK_revoke_privilegegroup()
5) _int AK_checkprivilege() , _int AK_check_userprivilege(), ...
6) _int AK_triggeredit() , _int AK_triggerrename() ...
1) ABORT - abort the current transaction 2) CREATE DATABASE - create a new database 3) ALTER DATABASE - change a database 4) ANALYZE - collect statistics about a database 5) CHECKPOINT - force a transaction log checkpoint 6) CLUSTER - cluster a table according to an index 7) COMMENT - define or change the comment of an object 8) COPY - copy data between files and tables 9) CREATE DOMAIN - define a new domain 10) DROP DOMAIN - remove a user-defined domain 11) LOCK - explicitly lock a table 12) TRUNCATE - empty a table 13) VACUUM - garbage-collect and optionally analyze a database
Javljam se za ažuriranje stanje.
STANJE NA 27.05.2020. 15:33 ------------------------------------------
Nakon posljednjeg pull requesta više nije moguća prijava s podacima "testingUser" i "testingPass" unutar klijenta. Potrebno je napraviti promjenu kod metode check_auth_password(self, username, password) u server_functions.py.
Uz to je još potrebno i popraviti metodu recv_data(self) u akdb_cli.py. Ona trenutno ništa ne vraća (nema naredbu return), a njezin rezultat je potreban za daljnji rad.
I. Popis naredbi koje se provjeravaju (u sql_executor.py) i zatim pokušavaju izvršiti kada ih se upiše unutar klijenta:
\p
create sequence
II. Popis naredbi koje bi bilo dobro implementirati u Python dijelu (sql_executor.py):
create user
III. Testiranje naredbi unutar klijenta:
akdb> create table proba(id int primary key) - [-] Failed command execution: execute() takes exactly 1 argument (2 given) (ne radi)
Napomena: Kako ne radi naredba za kreiranje tablice, automatski nećemo vidjeti niti rezultate ostalih naredbi koje se vežu na tu tablicu.
akdb> \p proba - [-] Failed command execution: execute() takes exactly 1 argument (2 given) (ne radi) akdb> \d proba - [-] Failed command execution: in method 'AK_num_attr', argument 1 of type 'char *' (ne radi) akdb> \t proba - There was a problem. Error message: Error. Wrong command: \t proba (ne radi) akdb> insert into proba values(1) - There was a problem. Error message: Error. Wrong command: insert into proba values(1) (ne radi) akdb> history - There was a problem. Error message: Error. Wrong command: history* (ne radi) akdb> select from proba - There was a problem. Error message: Error. Wrong command: select * from proba (ne radi) akdb> drop table proba - [-] Failed command execution: execute() takes exactly 1 argument (2 given) (ne radi) akdb> grant update on proba to public - [-] Failed command execution: execute() takes exactly 1 argument (2 given) (ne radi) akdb> update proba set id = 2 where id = 1 - There was a problem. Error message: Error. Wrong command: update proba set id = 2 where id = 1 (ne radi) akdb> create index najbolji_indeks on proba(id) - There was a problem. Error message: Error. Wrong command: ON table_name (column1create index najbolji_indeks on proba(id)** (ne radi)
create trigger
IV. Testiranje naredbi dostupnih unutar servera:
Za vrijeme izvođenja programa server.py, u terminalu je moguće koristiti sljedeće dvije naredbe:
stop - [-] Server closed (radi) start - [-] Server resumed (radi)
V. Naredbe koje su implementirane na strani C-a (bilo u obliku konkretne naredbe, bilo u obliku funkcionalnosti koja se može upotrijebiti), a nisu u Pythonu:
int AK_delete_row() int AK_function_change_return_type(), int AK_function_rename(), ... int AK_user_rename(), int AK_revoke_privilege_user() int AK_revoke_privilege_group() int AK_check_privilege(), int AK_check_user_privilege(), ... int AK_trigger_edit(), int AK_trigger_rename(), ...
VI. Standardne SQL naredbe koje nisu obuhvaćene ni prvim ni drugim dijelom:
abort - abort the current transaction create database - create a new database alter database - change a database analyze - collect statistics about a database checkpoint - force a transaction log checkpoint cluster - cluster a table according to an index comment - define or change a comment of an object copy - copy a data between files and tables create domain - define a new domain drop domain - remove a user-defined domain lock - explicitly lock a table truncate - empty a table vacuum - garbage-collect and optionally analyze a database
VII. Testovi
akdb> testme - Izvrše se svi testovi koji se nalaze u datoteci tests.py (19 testova). Ima grešaka koje je potrebno ispraviti
Javljam se za sljedeće ažuriranje stanja ovog issue-a .
Javljam se za rješavanje ovog issue-a.
U klijentskom sučelju testirati sve SQL naredbe i popisati ih. Provjeriti koje još naredbe su implementirane na strani C koda (bilo u obliku konkretne naredbe, bilo u obliku funkcionalnosti koja se može upotrijebiti), a nisu u Pythonu te ih također popisati. Na kraju, provjeriti koje standardne SQL naredbe nisu obuhvaćene niti prvim niti drugim dijelom, te ih također popisati. Sve popise poslati ovamo u komentar.