Version 16.155.7

This commit is contained in:
Antonio Cañas Vargas 2017-03-11 20:36:55 +01:00
parent 2570a8cc4c
commit f9f6e9fe05
4 changed files with 55 additions and 49 deletions

View File

@ -392,7 +392,7 @@ CREATE TABLE IF NOT EXISTS debug (
--
CREATE TABLE IF NOT EXISTS deg_types (
DegTypCod INT NOT NULL AUTO_INCREMENT,
DegTypName VARCHAR(32) NOT NULL,
DegTypName VARCHAR(511) NOT NULL,
UNIQUE INDEX(DegTypCod));
--
-- Table degrees: stores the degrees

View File

@ -207,13 +207,17 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.155.6 (2017-03-11)"
#define Log_PLATFORM_VERSION "SWAD 16.155.7 (2017-03-11)"
#define CSS_FILE "swad16.147.css"
#define JS_FILE "swad16.144.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/*
Version 16.155.7: Mar 11, 2017 Adjusting size of database fields. (216682 lines)
1 change necessary in database:
ALTER TABLE deg_types CHANGE COLUMN DegTypName DegTypName VARCHAR(511) NOT NULL;
Version 16.155.6: Mar 11, 2017 Adjusting size of database fields. (216677 lines)
1 change necessary in database:
ALTER TABLE crs_record_fields CHANGE COLUMN FieldName FieldName VARCHAR(2047) NOT NULL;

View File

@ -800,7 +800,7 @@ mysql> DESCRIBE crs_records;
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_records ("
"FieldCod INT NOT NULL,"
"UsrCod INT NOT NULL,"
"Txt TEXT NOT NULL,"
"Txt TEXT NOT NULL," // Cns_MAX_BYTES_TEXT
"UNIQUE INDEX(FieldCod,UsrCod))");
/***** Table crs_usr *****/
@ -871,17 +871,17 @@ mysql> DESCRIBE crs_usr_requests;
/***** Table deg_types *****/
/*
mysql> DESCRIBE deg_types;
+------------+-------------+------+-----+---------+----------------+
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+----------------+
+------------+--------------+------+-----+---------+----------------+
| DegTypCod | int(11) | NO | PRI | NULL | auto_increment |
| DegTypName | varchar(32) | NO | | NULL | |
+------------+-------------+------+-----+---------+----------------+
2 rows in set (0.00 sec)
| DegTypName | varchar(511) | NO | | NULL | |
+------------+--------------+------+-----+---------+----------------+
2 rows in set (0,00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS deg_types ("
"DegTypCod INT NOT NULL AUTO_INCREMENT,"
"DegTypName VARCHAR(32) NOT NULL,"
"DegTypName VARCHAR(511) NOT NULL," // Deg_MAX_BYTES_DEGREE_TYPE_NAME
"UNIQUE INDEX(DegTypCod))");
/***** Table degrees *****/

View File

@ -453,11 +453,13 @@ void DT_GetListDegreeTypes (void)
/***** Get types of degree from database *****/
sprintf (Query,"(SELECT deg_types.DegTypCod,deg_types.DegTypName AS DegTypName,"
" COUNT(degrees.DegCod)"
" FROM deg_types,degrees WHERE deg_types.DegTypCod=degrees.DegTypCod"
" FROM deg_types,degrees"
" WHERE deg_types.DegTypCod=degrees.DegTypCod"
" GROUP BY degrees.DegTypCod)"
" UNION "
"(SELECT DegTypCod,DegTypName,'0'"
" FROM deg_types WHERE DegTypCod NOT IN (SELECT DegTypCod FROM degrees))"
" FROM deg_types"
" WHERE DegTypCod NOT IN (SELECT DegTypCod FROM degrees))"
" ORDER BY DegTypName");
Gbl.Degs.DegTypes.Num = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get types of degree");
@ -608,7 +610,7 @@ long DT_GetParamOtherDegTypCod (void)
static unsigned DT_CountNumDegsOfType (long DegTypCod)
{
char Query[512];
char Query[128];
/***** Get number of degrees of a type from database *****/
sprintf (Query,"SELECT COUNT(*) FROM degrees WHERE DegTypCod='%ld'",
@ -622,7 +624,7 @@ static unsigned DT_CountNumDegsOfType (long DegTypCod)
bool DT_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp)
{
char Query[512];
char Query[128];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned long NumRows;
@ -678,7 +680,7 @@ bool DT_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp)
static void DT_RemoveDegreeTypeCompletely (long DegTypCod)
{
char Query[512];
char Query[128];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned long NumRow,NumRows;
@ -724,7 +726,7 @@ void DT_RenameDegreeType (void)
extern const char *Txt_The_type_of_degree_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_of_the_type_of_degree_X_has_not_changed;
struct DegreeType *DegTyp;
char Query[1024];
char Query[128 + Deg_MAX_BYTES_DEGREE_TYPE_NAME];
char NewNameDegTyp[Deg_MAX_BYTES_DEGREE_TYPE_NAME + 1];
DegTyp = &Gbl.Degs.EditingDegTyp;
@ -794,7 +796,7 @@ void DT_RenameDegreeType (void)
static bool DT_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod)
{
char Query[512];
char Query[256 + Deg_MAX_BYTES_DEGREE_TYPE_NAME];
/***** Get number of degree types with a name from database *****/
sprintf (Query,"SELECT COUNT(*) FROM deg_types"
@ -812,7 +814,7 @@ void DT_ChangeDegreeType (void)
extern const char *Txt_The_type_of_degree_of_the_degree_X_has_changed;
struct Degree *Deg;
long NewDegTypCod;
char Query[512];
char Query[128];
Deg = &Gbl.Degs.EditingDeg;