Vis enkel innførsel

dc.contributor.advisorMallaug, Tore
dc.contributor.authorBrevik, Magnus
dc.contributor.authorWilla, Lisa
dc.date.accessioned2021-09-15T16:46:22Z
dc.date.available2021-09-15T16:46:22Z
dc.date.issued2021
dc.identifierno.ntnu:inspera:83510435:83529124
dc.identifier.urihttps://hdl.handle.net/11250/2778040
dc.description.abstractBoolean er en standard datatype i de fleste computerspråk som tar verdiene "true" (sann) og "false" (usann). Dette er representert på flere forskjellige måter, fra Java som bruker "true" og "false", til C og de fleste SQLer, som buker 1 og 0, og noen språk har ingen eksplisitt boolean i det hele tatt. Standarden for BOOLEAN datatypen i SQL er beskrevet i ISO/IEC 9075-2:2016, som også fremsetter at alle SQL som følger standarden skal ha en BOOLEAN datatype. I MySQL er det for øyeblikket ingen BOOLEAN datatype. I stedet finnes ordet "BOOLEAN" som et alias for TINYINT(1). Dette betyr at en kolonne laget med ordet BOOLEAN kan lagre enhver integerverdi som kan bli lagret i én byte. Dette er et stort avvik fra ISO standarden, som fører til at MySQL ikke regnes som et "ekte" SQL. Ved å avvike fra SQL standarden risikerer Oracle å bli forbigått når valget om database blir gjort, og kan derfor miste salg og omdømme. Vår oppgave har vært å implementere en BOOLEAN datatype i det allerede eksisterende systemet MySQL, så den følger Oracles visjon for en BOOLEAN. Oppgaven kom med en liste med forventede funksjonaliteter og avvik fra ISO standarden, noen som skulle fikses, og noen som skulle forbli. Gjennom utviklingsprosessen har vi brukt taktikker inspirert av smidig utviklingsmetodikk, som parprogrammering, hyppige oppdateringer til kunden, og standup-møter for å bygge et fungerende produkt som tilfredsstiller så mange av kravene som mulig i løpet av den avsatte tiden. For å kunne implementere ny funksjonalitet i en så stort eksisterende kodebase måtte vi bruke mange timer på å lese, diskutere og analysere koden for å forstå hvilke endringer som måtte gjøres og hvilke endringer som var unødvendige. Det resulterende produktet er en BOOLEAN datatype integrert i MySQL, samt nye og oppdaterte tester for MySQL Test Suite. Produktet avviker noe fra standarden, og mangler implementasjon av noen av kravene fra Oracle, men sluttproduktet fungerer, og er nært et ferdig produkt som kan implementeres i den offisielle versjonen av MySQL. Videre arbeid inkluderer å implementere en måte å eksplisitt gjøre om (cast) mellom BOOLEAN og andre datatyper med CAST-funksjonen, oppdatere storage enginen NDB Cluster til å kunne bruke BOOLEAN datatypen, og å implementere ordet "UNKNOWN" som et alias for NULL når brukt i en BOOLEAN kontekst. disse funksjonalitetene har blitt utelatt grunnet tidsbegrensninger. For å få tilgang til interne dokumenter måtte vi bli ansatt og integreres i MySQL Optimizer teamet i Oracle Norge AS. Dette inkluderte flere kurs for nyansatte om alt fra sikkerhet på kontoret til innsidehandel og trakassering på arbeidsplassen.
dc.description.abstractThe boolean data type is a standard data type in most computer languages, taking the values "true" and "false". This is represented in several ways, from Java using "true" and "false2, to C and most SQLs using 1 and 0, and some languages not having explicit booleans at all. The standard for BOOLEAN data type in SQL is directed by ISO/IEC 9075-2:2016, which also states that any standard compliant SQL should have a BOOLEAN data type. In MySQL there is currently no BOOLEAN data type. Instead there is the word "BOOLEAN" which is an alias for TINYINT(1). This means that a column created with the word BOOLEAN is able to store any integer value that can be stored in one byte. This is a big ISO standard compliance issue, which leads to MySQL not being considered a "true" SQL. By not having completely standard compliant SQL Oracle risks being overlooked when the choice of database is made and therefore losing sales and reputation. Our task has been to implement a BOOLEAN data type in the preexisting system of MySQL, so that it follows Oracle's vision for a BOOLEAN. The task came with a list of expected features and deviances from the ISO standard, some to be amended, and some to be left as is. Throughout the development process we have used agile inspired development tactics such as pair programming, frequent customer collaboration, and standup meetings to build a working product that satisfies as many of the requirements as possible in the allotted time frame. To be able to implement a new feature in such a large preexisting code base, we had to spend many hours reading, discussing, and analyzing the code to understand which changes were needed and which were unnecessary. The resulting feature is a BOOLEAN data type integrated in MySQL, along with new and updated tests for the MySQL Test Suite. The feature is not fully standard compliant, and misses a couple of the requirements from Oracle, but the final product works, and is close to a finished product that can be implemented in the official version of MySQL. Further work would include implementing a way to explicitly cast between BOOLEAN and other data types with the CAST-function, updating the NDB Cluster storage engine to allow for the BOOLEAN data type, and implementing the word UNKNOWN as an alias for NULL in BOOLEAN context. These features have been omitted due to time constraints. To get access to internal documents we had to be employed and onboarded in the MySQL Optimizer Team at Oracle Norge AS. This included several "new hire"-courses on anything from office safety to insider trading and workplace harassment.
dc.languageeng
dc.publisherNTNU
dc.titleBOOLEAN data type in MySQL
dc.typeBachelor thesis


Tilhørende fil(er)

Thumbnail
Thumbnail

Denne innførselen finnes i følgende samling(er)

Vis enkel innførsel